├── .gitmodules ├── .x-sc_po_check ├── .x-sc_trailing_blank ├── ABOUT-NLS ├── AUTHORS ├── COPYING ├── ChangeLog ├── ChangeLog.README ├── MAILING-LIST ├── Makefile.am ├── NEWS ├── README ├── README.checkout ├── android ├── build.sh ├── setCrossEnvironment-armeabi-v7a.sh ├── setCrossEnvironment-armeabi.sh ├── setCrossEnvironment-mips.sh ├── setCrossEnvironment-x86.sh ├── wget ├── wget-armeabi ├── wget-armeabi-no-pie ├── wget-mips └── wget-x86 ├── bootstrap ├── bootstrap.conf ├── build-aux ├── build_info.pl └── link-warning.h ├── cfg.mk ├── configure.ac ├── doc ├── ChangeLog ├── Makefile.am ├── fdl.texi ├── sample.wgetrc ├── texi2pod.pl └── wget.texi ├── m4 ├── exitfail.m4 ├── getpagesize.m4 ├── wchar.m4 ├── wctype.m4 └── wget.m4 ├── msdos ├── ChangeLog ├── Makefile.DJ ├── Makefile.WC ├── config.h └── msdos.c ├── po ├── POTFILES.in ├── en@boldquot.header ├── en@quot.header ├── insert-header.sin ├── remove-potcdate.sin └── stamp-po ├── src ├── ChangeLog ├── DESCRIP_DEPS.MMS ├── DESCRIP_MODS.MMS ├── DESCRIP_SRC.MMS ├── Makefile.am ├── build_info.c.in ├── cmpt.c ├── connect.c ├── connect.h ├── convert.c ├── convert.h ├── cookies.c ├── cookies.h ├── css-tokens.h ├── css-url.c ├── css-url.h ├── css.l ├── decc_ver.c ├── exits.c ├── exits.h ├── ftp-basic.c ├── ftp-ls.c ├── ftp-opie.c ├── ftp.c ├── ftp.h ├── gettext.h ├── gnutls.c ├── hash.c ├── hash.h ├── host.c ├── host.h ├── html-parse.c ├── html-parse.h ├── html-url.c ├── html-url.h ├── http-ntlm.c ├── http-ntlm.h ├── http.c ├── http.h ├── init.c ├── init.h ├── iri.c ├── iri.h ├── log.c ├── log.h ├── main.c ├── mswindows.c ├── mswindows.h ├── netrc.c ├── netrc.h ├── openssl.c ├── options.h ├── progress.c ├── progress.h ├── ptimer.c ├── ptimer.h ├── recur.c ├── recur.h ├── res.c ├── res.h ├── retr.c ├── retr.h ├── spider.c ├── spider.h ├── ssl.h ├── sysdep.h ├── test.c ├── test.h ├── url.c ├── url.h ├── utils.c ├── utils.h ├── vms.c ├── warc.c ├── warc.h └── wget.h ├── tests ├── ChangeLog ├── FTPServer.pm ├── FTPTest.pm ├── HTTPServer.pm ├── HTTPTest.pm ├── Makefile.am ├── Test--httpsonly-r.px ├── Test--no-content-disposition-trivial.px ├── Test--no-content-disposition.px ├── Test--post-file.px ├── Test--spider-fail.px ├── Test--spider-r--no-content-disposition-trivial.px ├── Test--spider-r--no-content-disposition.px ├── Test--spider-r-HTTP-Content-Disposition.px ├── Test--spider-r.px ├── Test--spider.px ├── Test-E-k-K.px ├── Test-E-k.px ├── Test-HTTP-Content-Disposition-1.px ├── Test-HTTP-Content-Disposition-2.px ├── Test-HTTP-Content-Disposition.px ├── Test-N--no-content-disposition-trivial.px ├── Test-N--no-content-disposition.px ├── Test-N-HTTP-Content-Disposition.px ├── Test-N-current.px ├── Test-N-no-info.px ├── Test-N-old.px ├── Test-N-smaller.px ├── Test-N.px ├── Test-O--no-content-disposition-trivial.px ├── Test-O--no-content-disposition.px ├── Test-O-HTTP-Content-Disposition.px ├── Test-O-nc.px ├── Test-O-nonexisting.px ├── Test-O.px ├── Test-Restrict-Lowercase.px ├── Test-Restrict-Uppercase.px ├── Test-auth-basic.px ├── Test-auth-no-challenge-url.px ├── Test-auth-no-challenge.px ├── Test-auth-retcode.px ├── Test-auth-with-content-disposition.px ├── Test-c-full.px ├── Test-c-partial.px ├── Test-c-shorter.px ├── Test-c.px ├── Test-cookies-401.px ├── Test-cookies.px ├── Test-ftp-bad-list.px ├── Test-ftp-iri-disabled.px ├── Test-ftp-iri-fallback.px ├── Test-ftp-iri-recursive.px ├── Test-ftp-iri.px ├── Test-ftp-list-Multinet.px ├── Test-ftp-list-UNIX-hidden.px ├── Test-ftp-list-Unknown-a.px ├── Test-ftp-list-Unknown-hidden.px ├── Test-ftp-list-Unknown-list-a-fails.px ├── Test-ftp-list-Unknown.px ├── Test-ftp-pasv-fail.px ├── Test-ftp-recursive.px ├── Test-ftp.px ├── Test-i-ftp.px ├── Test-i-http.px ├── Test-idn-cmd-utf8.px ├── Test-idn-cmd.px ├── Test-idn-headers.px ├── Test-idn-meta.px ├── Test-idn-robots-utf8.px ├── Test-idn-robots.px ├── Test-iri-disabled.px ├── Test-iri-forced-remote.px ├── Test-iri-list.px ├── Test-iri-percent.px ├── Test-iri.px ├── Test-k.px ├── Test-meta-robots.px ├── Test-nonexisting-quiet.px ├── Test-noop.px ├── Test-np.px ├── Test-proxied-https-auth.px ├── Test-proxy-auth-basic.px ├── Test-restrict-ascii.px ├── Test-stdouterr.px ├── WgetFeature.cfg ├── WgetFeature.pm ├── WgetTest.pm.in ├── certs │ ├── server-cert.pem │ └── server-key.pem └── run-px ├── util ├── Makefile.am ├── README ├── freeopts ├── paramcheck.pl ├── rmold.pl └── trunc.c └── vms ├── COLLECT_DEPS.COM ├── CONFIG_EXTRACT.COM ├── DESCRIP.MMS ├── DESCRIP_MKDEPS.MMS ├── DESCRIP_SRC.MMS ├── DESCRIP_SRC_CMN.MMS ├── DESCRIP_SRC_FLAGS.MMS ├── VMS_NOTES.TXT ├── WGET.HLP ├── WGET_MULTINET.OPT ├── WGET_SSL_HP.OPT ├── WGET_SSL_O.OPT ├── alloca.h ├── config.h_vms ├── stdint.h ├── vms.h └── vms_ip.h /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "gnulib"] 2 | path = gnulib 3 | url = git://git.sv.gnu.org/gnulib.git 4 | -------------------------------------------------------------------------------- /.x-sc_po_check: -------------------------------------------------------------------------------- 1 | src/wget.h 2 | -------------------------------------------------------------------------------- /.x-sc_trailing_blank: -------------------------------------------------------------------------------- 1 | doc/wget.texi 2 | po/bg.po 3 | ChangeLog 4 | doc/ChangeLog 5 | src/ChangeLog 6 | windows/ChangeLog 7 | msdos/ChangeLog 8 | tests/ChangeLog 9 | build-aux/texinfo.tex 10 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Authors of GNU Wget. 2 | 3 | [ Note that this file does not attempt to list all the contributors to 4 | Wget; look at the ChangeLogs for that. This is a list of people who 5 | contributed sizeable amounts of code and assigned the copyright to 6 | the FSF. ] 7 | 8 | Hrvoje Niksic. Designed and implemented Wget. 9 | 10 | Gordon Matzigkeit. Wrote netrc.c and netrc.h. 11 | 12 | Darko Budor. Wrote initial support for Windows, wrote wsstartup.c, 13 | wsstartup.h and windecl.h. (The files were later renamed, but his 14 | code and ideas remained present.) 15 | 16 | Junio Hamano. Added support for FTP Opie and HTTP digest 17 | authentication. 18 | 19 | Dan Harkless. Added --backup-converted, --follow-tags, --html-extension, 20 | --ignore-tags, and --page-requisites; improved documentation; etc. Was 21 | the principle maintainer of GNU Wget for some time. 22 | 23 | Christian Fraenkel. Initially implemented SSL support. 24 | 25 | Thomas Lussnig. Initially implemented IPv6 support. 26 | 27 | Ian Abbott. Contributed bugfixes, Windows-related fixes, provided a 28 | prototype implementation of the new recursive code, and more. 29 | Co-maintained Wget during the 1.8 release cycle. 30 | 31 | Gisle Vanem. Contributed Windows and MS-DOS improvements, including a 32 | port of run_with_timeout to Windows, additions to Makefiles, and many 33 | bug reports and fixes. 34 | 35 | Mauro Tortonesi. Improved IPv6 support, adding support for dual 36 | family systems. Refactored and enhanced FTP IPv6 code. Maintained GNU 37 | Wget from 2004-2007. 38 | 39 | Nicolas Schodet. Contributed to cookie code and documentation. 40 | 41 | Daniel Stenberg. NTLM authentication in http-ntlm.c and http-ntlm.h 42 | originally written for curl donated for use in GNU Wget. 43 | 44 | Micah Cowan. Maintained Wget from mid-2007 to mid-2010. 45 | 46 | Ralf Wildenhues. Contributed patches to convert Wget to use Automake as 47 | part of its build process, and various bugfixes. 48 | 49 | Steven Schubiger. Many helpful patches, bugfixes and improvements. 50 | Notably, conversion of Wget to use the Gnulib quotes and quoteargs 51 | modules, and the addition of password prompts at the console, via the 52 | Gnulib getpasswd-gnu module. 53 | 54 | Ted Mielczarek. Support for parsing links from CSS. 55 | 56 | Saint Xavier. Support for IRIs (RFC 3987). 57 | 58 | Giuseppe Scrivano. Added support for HTTP/1.1. Current Wget maintainer. 59 | -------------------------------------------------------------------------------- /ChangeLog.README: -------------------------------------------------------------------------------- 1 | Please note that Wget has more than one ChangeLog file: 2 | 3 | ./ChangeLog: documents changes to files in the top-level directory 4 | and to files in subdirectories like po/ that don't have 5 | their own ChangeLogs 6 | 7 | src/ChangeLog: documents only changes to files in the src directory 8 | 9 | doc/ChangeLog: documents only changes to files in the doc directory 10 | 11 | windows/ChangeLog: documents only changes to files in the windows directory 12 | 13 | msdos/ChangeLog: documents only changes to files in the msdos directory 14 | 15 | When checking to see if a patch you sent in has been applied, please 16 | look in the appropriate ChangeLog(s). 17 | -------------------------------------------------------------------------------- /MAILING-LIST: -------------------------------------------------------------------------------- 1 | Mailing Lists 2 | ============= 3 | 4 | Primary List 5 | ------------ 6 | 7 | The primary mailinglist for discussion, bug-reports, or questions about 8 | GNU Wget is at . To subscribe, send an email to 9 | , or visit 10 | `http://lists.gnu.org/mailman/listinfo/bug-wget'. 11 | 12 | You do not need to subscribe to send a message to the list; however, 13 | please note that unsubscribed messages are moderated, and may take a 14 | while before they hit the list--*usually around a day*. If you want 15 | your message to show up immediately, please subscribe to the list 16 | before posting. Archives for the list may be found at 17 | `http://lists.gnu.org/pipermail/bug-wget/'. 18 | 19 | An NNTP/Usenettish gateway is also available via Gmane 20 | (http://gmane.org/about.php). You can see the Gmane archives at 21 | `http://news.gmane.org/gmane.comp.web.wget.general'. Note that the 22 | Gmane archives conveniently include messages from both the current 23 | list, and the previous one. Messages also show up in the Gmane archives 24 | sooner than they do at `lists.gnu.org'. 25 | 26 | Bug Notices List 27 | ---------------- 28 | 29 | Additionally, there is the mailing 30 | list. This is a non-discussion list that receives bug report 31 | notifications from the bug-tracker. To subscribe to this list, send an 32 | email to , or visit 33 | `http://addictivecode.org/mailman/listinfo/wget-notify'. 34 | 35 | Obsolete Lists 36 | -------------- 37 | 38 | Previously, the mailing list was used as the main 39 | discussion list, and another list, was used 40 | for submitting and discussing patches to GNU Wget. 41 | 42 | Messages from are archived at 43 | `http://www.mail-archive.com/wget%40sunsite.dk/' and at 44 | 45 | `http://news.gmane.org/gmane.comp.web.wget.general' (which also 46 | continues to archive the current list, ). 47 | 48 | Messages from are archived at 49 | `http://news.gmane.org/gmane.comp.web.wget.patches'. 50 | 51 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile for `Wget' utility 2 | # Copyright (C) 1995, 1996, 1997, 2006, 2007, 2008, 2009, 2010, 2011 3 | # Free Software Foundation, Inc. 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3 of the License, or 8 | # (at your option) any later version. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | # Additional permission under GNU GPL version 3 section 7 19 | 20 | # If you modify this program, or any covered work, by linking or 21 | # combining it with the OpenSSL project's OpenSSL library (or a 22 | # modified version of that library), containing parts covered by the 23 | # terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 24 | # grants you additional permission to convey the resulting work. 25 | # Corresponding Source for a non-source form of such a combination 26 | # shall include the source code for the parts of OpenSSL used as well 27 | # as that of the covered work. 28 | 29 | # 30 | # Version: @VERSION@ 31 | # 32 | 33 | 34 | # We can't help that installing wget.info leaves /usr/share/info/dir 35 | # around, and we need to prevent uninstallation of the possibly 36 | # previously-existing /etc/wgetrc. 37 | distuninstallcheck_listfiles = find . -type f | \ 38 | grep -Ev '(/share/info/dir|/etc/wgetrc)$$' 39 | 40 | # Search for macros in the m4 subdirectory: 41 | ACLOCAL_AMFLAGS = -I m4 42 | 43 | # subdirectories in the distribution 44 | SUBDIRS = lib src doc po tests util 45 | 46 | EXTRA_DIST = ChangeLog.README MAILING-LIST \ 47 | msdos/ChangeLog msdos/config.h msdos/Makefile.DJ \ 48 | msdos/Makefile.WC ABOUT-NLS \ 49 | build-aux/build_info.pl build-aux/git-version-gen .version 50 | 51 | CLEANFILES = *~ *.bak $(DISTNAME).tar.gz 52 | 53 | BUILT_SOURCES = .version 54 | 55 | clean-generic: 56 | rm -f install-info 57 | 58 | .version: 59 | echo $(VERSION) > $@-t && mv $@-t $@ 60 | 61 | # Arrange so that .tarball-version appears only in the distribution 62 | # tarball, and never in a checked-out repository. 63 | dist-hook: 64 | $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version 65 | -------------------------------------------------------------------------------- /README.checkout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pelya/wget-android/b6a8d87904ca5e1ed01813d5709a8fc2787afc33/README.checkout -------------------------------------------------------------------------------- /android/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | NCPU=4 4 | ARCH_LIST="armeabi x86 mips" 5 | 6 | [ -d openssl ] || { 7 | mkdir -p openssl 8 | git clone https://android.googlesource.com/platform/external/openssl openssl/jni -b kitkat-mr2.2-release || exit 1 9 | #sed -i 's/BUILD_HOST_SHARED_LIBRARY/BUILD_SHARED_LIBRARY/g' openssl/jni/*.mk 10 | #sed -i 's/BUILD_HOST_STATIC_LIBRARY/BUILD_STATIC_LIBRARY/g' openssl/jni/*.mk 11 | sed -i 's@external/openssl/@jni/@g' openssl/jni/*.mk 12 | echo > openssl/jni/Apps.mk 13 | echo APP_MODULES := libcrypto_static libssl_static > openssl/jni/Application.mk 14 | echo APP_ABI := $ARCH_LIST >> openssl/jni/Application.mk 15 | ndk-build -j$NCPU -C openssl BUILD_HOST_SHARED_LIBRARY=jni/Apps.mk BUILD_HOST_STATIC_LIBRARY=jni/Apps.mk || exit 1 16 | for ARCH in $ARCH_LIST; do 17 | mkdir -p openssl/$ARCH/lib 18 | ln -s -f ../jni/include openssl/$ARCH/include 19 | cp -f openssl/obj/local/$ARCH/libcrypto_static.a openssl/$ARCH/lib/libcrypto.a || exit 1 20 | cp -f openssl/obj/local/$ARCH/libssl_static.a openssl/$ARCH/lib/libssl.a || exit 1 21 | done 22 | } 23 | 24 | [ -e ../configure ] || { 25 | D="`pwd`" 26 | cd .. 27 | ./bootstrap || exit 1 28 | cd "$D" 29 | } 30 | 31 | for ARCH in $ARCH_LIST; do 32 | 33 | case $ARCH in 34 | x86) TOOLCHAIN=i686-linux-android;; 35 | mips) TOOLCHAIN=mipsel-linux-android;; 36 | *) TOOLCHAIN=arm-linux-androideabi;; 37 | esac 38 | 39 | mkdir -p $ARCH 40 | cd $ARCH 41 | export LDFLAGS=-pie 42 | [ -e Makefile ] || { 43 | ../setCrossEnvironment-$ARCH.sh ../../configure --host=$TOOLCHAIN --with-ssl=openssl --with-libssl-prefix=`pwd`/../openssl/$ARCH --disable-nls --disable-iri || exit 1 44 | } || exit 1 45 | 46 | make -j$NCPU || exit 1 47 | cp -f src/wget . 48 | ../setCrossEnvironment-$ARCH.sh sh -c '$STRIP --strip-unneeded wget' || exit 1 49 | cd .. 50 | 51 | done 52 | -------------------------------------------------------------------------------- /android/wget: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pelya/wget-android/b6a8d87904ca5e1ed01813d5709a8fc2787afc33/android/wget -------------------------------------------------------------------------------- /android/wget-armeabi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pelya/wget-android/b6a8d87904ca5e1ed01813d5709a8fc2787afc33/android/wget-armeabi -------------------------------------------------------------------------------- /android/wget-armeabi-no-pie: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pelya/wget-android/b6a8d87904ca5e1ed01813d5709a8fc2787afc33/android/wget-armeabi-no-pie -------------------------------------------------------------------------------- /android/wget-mips: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pelya/wget-android/b6a8d87904ca5e1ed01813d5709a8fc2787afc33/android/wget-mips -------------------------------------------------------------------------------- /android/wget-x86: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pelya/wget-android/b6a8d87904ca5e1ed01813d5709a8fc2787afc33/android/wget-x86 -------------------------------------------------------------------------------- /bootstrap.conf: -------------------------------------------------------------------------------- 1 | # bootstrap.conf - Bootstrap configuration. 2 | # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, 3 | # Inc. 4 | # 5 | # This file is part of GNU Wget. 6 | # 7 | # GNU Wget is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, either version 3 of the License, or (at 10 | # your option) any later version. 11 | # 12 | # GNU Wgt is distributed in the hope that it will be useful, but 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | # General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program. If not, see `http://www.gnu.org/licenses/'. 19 | 20 | # gnulib library name 21 | gnulib_name=libgnu 22 | gnulib_tool_option_extras= 23 | use_libtool=0 24 | checkout_only_file= 25 | 26 | # gnulib modules used by this package. 27 | gnulib_modules=" 28 | accept 29 | alloca 30 | announce-gen 31 | base32 32 | bind 33 | c-ctype 34 | clock-time 35 | close 36 | connect 37 | fcntl 38 | futimens 39 | ftello 40 | getaddrinfo 41 | getopt-gnu 42 | getpass-gnu 43 | getpeername 44 | getsockname 45 | git-version-gen 46 | gnupload 47 | ioctl 48 | iconv 49 | iconv-h 50 | listen 51 | maintainer-makefile 52 | mbtowc 53 | mkdir 54 | mkstemp 55 | mkostemp 56 | crypto/md5 57 | crypto/sha1 58 | pipe 59 | quote 60 | quotearg 61 | recv 62 | regex 63 | select 64 | send 65 | setsockopt 66 | sigprocmask 67 | sigpipe 68 | snprintf 69 | socket 70 | stdbool 71 | strcasestr 72 | strerror_r-posix 73 | strtok_r 74 | tmpdir 75 | unlocked-io 76 | update-copyright 77 | vasprintf 78 | vsnprintf 79 | write 80 | " 81 | 82 | gnulib_extra_files=" 83 | $build_aux/install-sh 84 | $build_aux/mdate-sh 85 | $build_aux/texinfo.tex 86 | $build_aux/depcomp 87 | $build_aux/config.guess 88 | $build_aux/config.sub 89 | $build_aux/config.rpath 90 | doc/INSTALL 91 | " 92 | 93 | # Build prerequisites 94 | buildreq="\ 95 | autoconf 2.62 96 | automake 1.11.1 97 | autopoint - 98 | gettext 0.17 99 | git 1.4.4 100 | makeinfo - 101 | perl 5.5 102 | rsync - 103 | tar - 104 | xz - 105 | " 106 | -------------------------------------------------------------------------------- /build-aux/link-warning.h: -------------------------------------------------------------------------------- 1 | /* GL_LINK_WARNING("literal string") arranges to emit the literal string as 2 | a linker warning on most glibc systems. 3 | We use a linker warning rather than a preprocessor warning, because 4 | #warning cannot be used inside macros. */ 5 | #ifndef GL_LINK_WARNING 6 | /* This works on platforms with GNU ld and ELF object format. 7 | Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. 8 | Testing __ELF__ guarantees the ELF object format. 9 | Testing __GNUC__ is necessary for the compound expression syntax. */ 10 | # if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ 11 | # define GL_LINK_WARNING(message) \ 12 | GL_LINK_WARNING1 (__FILE__, __LINE__, message) 13 | # define GL_LINK_WARNING1(file, line, message) \ 14 | GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ 15 | # define GL_LINK_WARNING2(file, line, message) \ 16 | GL_LINK_WARNING3 (file ":" #line ": warning: " message) 17 | # define GL_LINK_WARNING3(message) \ 18 | ({ static const char warning[sizeof (message)] \ 19 | __attribute__ ((__unused__, \ 20 | __section__ (".gnu.warning"), \ 21 | __aligned__ (1))) \ 22 | = message "\n"; \ 23 | (void)0; \ 24 | }) 25 | # else 26 | # define GL_LINK_WARNING(message) ((void) 0) 27 | # endif 28 | #endif 29 | -------------------------------------------------------------------------------- /cfg.mk: -------------------------------------------------------------------------------- 1 | export VC_LIST_EXCEPT_DEFAULT=^(lib/.*|m4/.*|md5/.*|build-aux/.*|src/gettext\.h|.*ChangeLog)$$ 2 | 3 | local-checks-to-skip = \ 4 | sc_const_long_option \ 5 | sc_error_message_uppercase \ 6 | sc_file_system \ 7 | sc_makefile_TAB_only_indentation \ 8 | sc_immutable_NEWS \ 9 | sc_copyright_check \ 10 | sc_makefile_path_separator_check \ 11 | sc_require_config_h \ 12 | sc_require_config_h_first \ 13 | sc_two_space_separator_in_usage \ 14 | sc_useless_cpp_parens \ 15 | \ 16 | sc_space_tab \ 17 | sc_prohibit_atoi_atof \ 18 | sc_prohibit_strcmp \ 19 | sc_makefile_check \ 20 | sc_cast_of_alloca_return_value \ 21 | sc_cast_of_x_alloc_return_value \ 22 | sc_prohibit_S_IS_definition \ 23 | \ 24 | sc_program_name \ 25 | 26 | 27 | #SHELL=bash -x 28 | show-vc-list-except: 29 | @$(VC_LIST_EXCEPT) 30 | -------------------------------------------------------------------------------- /m4/exitfail.m4: -------------------------------------------------------------------------------- 1 | # exitfail.m4 serial 6 2 | dnl Copyright (C) 2002, 2003, 2005, 2006, 2010, 2011 Free Software 3 | dnl Foundation, Inc. 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | 8 | AC_DEFUN([gl_EXITFAIL], 9 | [ 10 | AC_LIBOBJ([exitfail]) 11 | 12 | dnl No prerequisites of lib/exitfail.c. 13 | : 14 | ]) 15 | -------------------------------------------------------------------------------- /m4/getpagesize.m4: -------------------------------------------------------------------------------- 1 | # getpagesize.m4 serial 7 2 | dnl Copyright (C) 2002, 2004, 2005, 2007, 2010, 2011 Free Software 3 | dnl Foundation, Inc. 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | 8 | AC_DEFUN([gl_FUNC_GETPAGESIZE], 9 | [ 10 | AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) 11 | AC_REQUIRE([AC_CANONICAL_HOST]) 12 | AC_CHECK_FUNCS([getpagesize]) 13 | if test $ac_cv_func_getpagesize = no; then 14 | HAVE_GETPAGESIZE=0 15 | AC_CHECK_HEADERS([OS.h]) 16 | if test $ac_cv_header_OS_h = yes; then 17 | HAVE_OS_H=1 18 | fi 19 | AC_CHECK_HEADERS([sys/param.h]) 20 | if test $ac_cv_header_sys_param_h = yes; then 21 | HAVE_SYS_PARAM_H=1 22 | fi 23 | fi 24 | case "$host_os" in 25 | mingw*) 26 | REPLACE_GETPAGESIZE=1 27 | AC_LIBOBJ([getpagesize]) 28 | ;; 29 | esac 30 | ]) 31 | -------------------------------------------------------------------------------- /m4/wctype.m4: -------------------------------------------------------------------------------- 1 | # wctype.m4 serial 2 2 | 3 | dnl A placeholder for ISO C99 , for platforms that lack it. 4 | 5 | dnl Copyright (C) 2006, 2007, 2008, 2010, 2011 Free Software Foundation, 6 | dnl Inc. 7 | dnl This file is free software; the Free Software Foundation 8 | dnl gives unlimited permission to copy and/or distribute it, 9 | dnl with or without modifications, as long as this notice is preserved. 10 | 11 | dnl Written by Paul Eggert. 12 | 13 | AC_DEFUN([gl_WCTYPE_H], 14 | [ 15 | AC_REQUIRE([AC_PROG_CC]) 16 | AC_CHECK_FUNCS_ONCE([iswcntrl]) 17 | if test $ac_cv_func_iswcntrl = yes; then 18 | HAVE_ISWCNTRL=1 19 | else 20 | HAVE_ISWCNTRL=0 21 | fi 22 | AC_SUBST([HAVE_ISWCNTRL]) 23 | AC_CHECK_HEADERS_ONCE([wctype.h]) 24 | AC_REQUIRE([AC_C_INLINE]) 25 | 26 | AC_REQUIRE([gt_TYPE_WINT_T]) 27 | if test $gt_cv_c_wint_t = yes; then 28 | HAVE_WINT_T=1 29 | else 30 | HAVE_WINT_T=0 31 | fi 32 | AC_SUBST([HAVE_WINT_T]) 33 | 34 | WCTYPE_H=wctype.h 35 | if test $ac_cv_header_wctype_h = yes; then 36 | if test $ac_cv_func_iswcntrl = yes; then 37 | dnl Linux libc5 has an iswprint function that returns 0 for all arguments. 38 | dnl The other functions are likely broken in the same way. 39 | AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works], 40 | [ 41 | AC_TRY_RUN([#include 42 | #include 43 | #include 44 | #include 45 | #include 46 | int main () { return iswprint ('x') == 0; }], 47 | [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no], 48 | [AC_TRY_COMPILE([#include 49 | #if __GNU_LIBRARY__ == 1 50 | Linux libc5 i18n is broken. 51 | #endif], [], 52 | [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no]) 53 | ]) 54 | ]) 55 | if test $gl_cv_func_iswcntrl_works = yes; then 56 | WCTYPE_H= 57 | fi 58 | fi 59 | dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty, 60 | dnl for the benefit of builds from non-distclean directories. 61 | gl_CHECK_NEXT_HEADERS([wctype.h]) 62 | HAVE_WCTYPE_H=1 63 | else 64 | HAVE_WCTYPE_H=0 65 | fi 66 | AC_SUBST([HAVE_WCTYPE_H]) 67 | AC_SUBST([WCTYPE_H]) 68 | 69 | if test "$gl_cv_func_iswcntrl_works" = no; then 70 | REPLACE_ISWCNTRL=1 71 | else 72 | REPLACE_ISWCNTRL=0 73 | fi 74 | AC_SUBST([REPLACE_ISWCNTRL]) 75 | ]) 76 | -------------------------------------------------------------------------------- /msdos/ChangeLog: -------------------------------------------------------------------------------- 1 | 2009-09-06 Gisle Vanem 2 | 3 | * Makefile.WC: Added compilation of new file msdos.c. 4 | Simplified; no need to have explicit rules for files in ./lib and 5 | ./md5. Just use the suffix search path mechanism in wmake. 6 | 7 | 2009-09-06 Gisle Vanem 8 | 9 | * Makefile.DJ: Added compilation of new file msdos.c. 10 | 11 | 2009-09-05 Gisle Vanem 12 | 13 | * config.h: Added 'HAVE_ALLOCA_H' for Watcom 1.5+. Added 14 | 'USE_WATT32' since all DOS-targets use the Watt-32 tcp/ip stack. 15 | Added meaningless dummy LOCALEDIR. 16 | 17 | * Makefile.WC: A much needed update. Added rules for many files 18 | in ./lib, css.c and version.c. 19 | 20 | * Makefile.DJ: A much needed update. Added rules for css.c and 21 | version.c. 22 | 23 | 2008-01-25 Micah Cowan 24 | 25 | * config.h: Updated copyright year. 26 | 27 | 2007-11-28 Micah Cowan 28 | 29 | * config.h: Updated license exception for OpenSSL, per the SFLC. 30 | 31 | 2007-10-15 Gisle Vanem 32 | 33 | * config.h: Added some HAVE_* for djgpp 2.04 and Watcom 1.7+. 34 | 35 | * Makefile.DJ: rewritten for including some files from ../lib. 36 | 37 | * Makefile.WC: Ditto. Handling source-files out-of current 38 | directory makes compliation a bit more painfull. AFAICS, one 39 | must use explicit rules. 40 | 41 | 2007-10-02 Gisle Vanem 42 | 43 | * config.h: Removed unused defines, added needed 'HAVE_*' defines. 44 | 45 | * Makefile.DJ: rewritten to be used from './src' directory. 46 | Added '-DOPENSSL_NO_KRB5' for OpenSSL build. Target is 47 | now wget.exe. 48 | 49 | * Makefile.WC: Added for building with OpenWatcom targeting 50 | 32-bit DOS (DOS32A extender). 51 | 52 | 2007-09-24 Gisle Vanem 53 | 54 | * Makefile.DJ, config.h: Added to support building on MS-DOS via 55 | DJGPP. 56 | -------------------------------------------------------------------------------- /msdos/Makefile.DJ: -------------------------------------------------------------------------------- 1 | # 2 | # GNU Makefile for wget / djgpp / MSDOS. 3 | # By Gisle Vanem 2009. 4 | # 5 | # `cd' to `./src' and issue the command: 6 | # make -f ../msdos/Makefile.dj depend 7 | # followed by: 8 | # make -f ../msdos/Makefile.dj 9 | # 10 | VERSION = 1.12 (djgpp/DOS) 11 | 12 | .SUFFIXES: .exe 13 | 14 | VPATH = ../lib ../md5 ../msdos 15 | 16 | USE_OPENSSL = 0 17 | USE_IPV6 = 1 18 | 19 | # 20 | # Change to suite. 21 | # 22 | OPENSSL_ROOT = e:/net/OpenSSL.099 23 | ZLIB_ROOT = e:/djgpp/contrib/zlib 24 | 25 | OBJ_DIR = djgpp.obj 26 | CC = gcc 27 | CFLAGS = -O2 -g -Wall -Wcast-align -I. -I../msdos -I../lib -I../md5 \ 28 | -I/dev/env/WATT_ROOT/inc -DHAVE_CONFIG_H -DENABLE_DEBUG \ 29 | -DUSE_WATT32 30 | 31 | # LDFLAGS = -s 32 | 33 | ifeq ($(USE_OPENSSL),1) 34 | CFLAGS += -DHAVE_OPENSSL -DHAVE_SSL -DOPENSSL_NO_KRB5 -I$(OPENSSL_ROOT) 35 | EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a \ 36 | $(ZLIB_ROOT)/libz.a 37 | SOURCES += openssl.c http-ntlm.c 38 | endif 39 | 40 | ifeq ($(USE_IPV6),1) 41 | CFLAGS += -DENABLE_IPV6 42 | endif 43 | 44 | EX_LIBS += /dev/env/WATT_ROOT/lib/libwatt.a 45 | 46 | SOURCES += cmpt.c connect.c cookies.c exits.c ftp.c ftp-basic.c ftp-ls.c \ 47 | ftp-opie.c hash.c host.c html-parse.c html-url.c http.c \ 48 | init.c log.c main.c gen-md5.c netrc.c progress.c recur.c \ 49 | res.c retr.c snprintf.c url.c utils.c version.c convert.c \ 50 | ptimer.c spider.c css.c css-url.c build_info.c ../md5/md5.c \ 51 | ../msdos/msdos.c \ 52 | $(addprefix ../lib/, error.c exitfail.c quote.c \ 53 | quotearg.c getopt.c getopt1.c xalloc-die.c xmalloc.c) 54 | 55 | OBJECTS = $(addprefix $(OBJ_DIR)/, $(notdir $(SOURCES:.c=.o))) 56 | 57 | all: $(OBJ_DIR) wget.exe 58 | @echo 'Welcome to Wget' 59 | 60 | $(OBJ_DIR): 61 | mkdir $(OBJ_DIR) 62 | 63 | wget.exe: $(OBJECTS) 64 | $(CC) $(LDFLAGS) -o $@ $^ $(EX_LIBS) 65 | 66 | css.c: css.l 67 | flex -8 -o$@ $^ 68 | 69 | clean: 70 | rm -f $(OBJ_DIR)/*.o $(MAPFILE) 71 | 72 | vclean realclean: clean 73 | rm -f wget.exe depend.dj version.c 74 | - rmdir $(OBJ_DIR) 75 | 76 | $(OBJ_DIR)/%.o: %.c 77 | $(CC) $(CFLAGS) -o $@ -c $< 78 | @echo 79 | 80 | version.c: ../msdos/Makefile.DJ 81 | @echo 'char *version_string = "$(VERSION)";' > $@ 82 | @echo 'char *compilation_string = "$(CC) $(CFLAGS)";' >> $@ 83 | @echo 'char *link_string = "$(CC) $(LDFLAGS) -o wget.exe $$(OBJECTS) $(EX_LIBS)";' >> $@ 84 | 85 | depend: version.c 86 | $(CC) -MM $(CFLAGS) $(SOURCES) | \ 87 | sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj 88 | 89 | -include depend.dj 90 | 91 | -------------------------------------------------------------------------------- /msdos/Makefile.WC: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for Wget / DOS32A / OpenWatcom 3 | # by G. Vanem 2009 4 | # 5 | 6 | VERSION = 1.12 (Watcom/DOS) 7 | 8 | COMPILE = *wcc386 -mf -3r -w3 -d2 -zq -zm -of -I. -I$(%watt_root)\inc & 9 | -I..\msdos -I..\lib -I..\md5 -fr=nul -bt=dos -s -dHAVE_CONFIG_H & 10 | -dENABLE_DEBUG -dSIZEOF_INT=4 -dUSE_WATT32 11 | 12 | LINK = *wlink option quiet, map, verbose, eliminate, caseexact, stack=100k & 13 | debug all system dos32a 14 | 15 | .c: ..\lib 16 | .c: ..\md5 17 | .c: ..\msdos 18 | 19 | 20 | OBJ_DIR = WC_DOS.obj 21 | 22 | OBJECTS = $(OBJ_DIR)\cmpt.obj $(OBJ_DIR)\build_info.obj & 23 | $(OBJ_DIR)\c-ctype.obj $(OBJ_DIR)\cookies.obj & 24 | $(OBJ_DIR)\connect.obj $(OBJ_DIR)\convert.obj & 25 | $(OBJ_DIR)\css.obj $(OBJ_DIR)\css-url.obj & 26 | $(OBJ_DIR)\error.obj $(OBJ_DIR)\exits.obj & 27 | $(OBJ_DIR)\exitfail.obj $(OBJ_DIR)\ftp-basic.obj & 28 | $(OBJ_DIR)\ftp-ls.obj $(OBJ_DIR)\ftp-opie.obj & 29 | $(OBJ_DIR)\ftp.obj $(OBJ_DIR)\gen-md5.obj & 30 | $(OBJ_DIR)\getopt.obj $(OBJ_DIR)\getopt1.obj & 31 | $(OBJ_DIR)\hash.obj $(OBJ_DIR)\msdos.obj & 32 | $(OBJ_DIR)\host.obj $(OBJ_DIR)\html-parse.obj & 33 | $(OBJ_DIR)\html-url.obj $(OBJ_DIR)\http.obj & 34 | $(OBJ_DIR)\init.obj $(OBJ_DIR)\log.obj & 35 | $(OBJ_DIR)\main.obj $(OBJ_DIR)\md5.obj & 36 | $(OBJ_DIR)\netrc.obj $(OBJ_DIR)\progress.obj & 37 | $(OBJ_DIR)\ptimer.obj $(OBJ_DIR)\recur.obj & 38 | $(OBJ_DIR)\res.obj $(OBJ_DIR)\retr.obj & 39 | $(OBJ_DIR)\spider.obj $(OBJ_DIR)\url.obj & 40 | $(OBJ_DIR)\utils.obj $(OBJ_DIR)\version.obj & 41 | $(OBJ_DIR)\xalloc-die.obj $(OBJ_DIR)\xmalloc.obj & 42 | $(OBJ_DIR)\quote.obj $(OBJ_DIR)\quotearg.obj 43 | 44 | all: $(OBJ_DIR) wget.exe .SYMBOLIC 45 | @echo 'Welcome to Wget / Watcom' 46 | 47 | $(OBJ_DIR): 48 | - mkdir $^@ 49 | 50 | .ERASE 51 | .c{$(OBJ_DIR)}.obj: .AUTODEPEND 52 | *$(COMPILE) -fo=$@ $[@ 53 | 54 | css.c: css.l 55 | flex -8 -o$@ $[@ 56 | 57 | wget.exe: $(OBJECTS) 58 | $(LINK) name $@ file { $(OBJECTS) } library $(%watt_root)\lib\wattcpwf.lib 59 | 60 | version.c: ..\msdos\Makefile.WC 61 | @echo char *version_string = "$(VERSION)"; > $@ 62 | @echo char *compilation_string = "$(COMPILE)"; >> $@ 63 | @echo char *link_string = "$(LINK) name wget.exe file { $$(OBJECTS) }"; >> $@ 64 | 65 | clean: .SYMBOLIC 66 | - rm $(OBJ_DIR)\*.obj wget.exe wget.map version.c css.c 67 | - rmdir $(OBJ_DIR) 68 | 69 | -------------------------------------------------------------------------------- /msdos/msdos.c: -------------------------------------------------------------------------------- 1 | /* MSDOS utility functions. 2 | Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. 3 | 4 | This file is part of GNU Wget. 5 | 6 | GNU Wget is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GNU Wget is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Wget. If not, see . 18 | 19 | Additional permission under GNU GPL version 3 section 7 20 | 21 | If you modify this program, or any covered work, by linking or 22 | combining it with the OpenSSL project's OpenSSL library (or a 23 | modified version of that library), containing parts covered by the 24 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 25 | grants you additional permission to convey the resulting work. 26 | Corresponding Source for a non-source form of such a combination 27 | shall include the source code for the parts of OpenSSL used as well 28 | as that of the covered work. */ 29 | 30 | #include "wget.h" 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | /* This variable (i.e. MB_CUR_MAX) is set here so that we force a unibyte 38 | locale in ../lib/quotearg.c. */ 39 | #ifdef __DJGPP__ 40 | int __dj_mb_cur_max = 1; 41 | #endif 42 | 43 | #ifndef __WATCOMC__ 44 | /* These is just a dummy function to make Wget link. These are never called 45 | because 'unibyte_locale == 1' in ../lib/quotearg.c. */ 46 | int mbsinit (void) 47 | { 48 | return 0; 49 | } 50 | 51 | int mbrtowc (void) 52 | { 53 | return 0; 54 | } 55 | 56 | int iswprint (void) 57 | { 58 | return 0; 59 | } 60 | #endif /* __WATCOMC__ */ 61 | 62 | 63 | #define PASS_MAX 512 64 | 65 | /* Get a user string with echo off. Handy for entering passwords. The prompt 66 | optional. */ 67 | char * 68 | getpass (const char *prompt) 69 | { 70 | char getpassbuf[PASS_MAX + 1]; 71 | size_t i = 0; 72 | int c; 73 | 74 | if (prompt) 75 | { 76 | fputs (prompt, stderr); 77 | fflush (stderr); 78 | } 79 | 80 | for (;;) 81 | { 82 | c = getch (); 83 | if (c == '\r') 84 | { 85 | getpassbuf[i] = '\0'; 86 | break; 87 | } 88 | else if (i < PASS_MAX) 89 | { 90 | getpassbuf[i++] = c; 91 | } 92 | 93 | if (i >= PASS_MAX) 94 | { 95 | getpassbuf[i] = '\0'; 96 | break; 97 | } 98 | } 99 | 100 | if (prompt) 101 | { 102 | fputs ("\r\n", stderr); 103 | fflush (stderr); 104 | } 105 | 106 | return strdup (getpassbuf); 107 | } 108 | 109 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of files which containing translatable strings. 2 | # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 3 | # 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 4 | # Foundation, Inc. 5 | 6 | # Package source files 7 | lib/error.c 8 | lib/gai_strerror.c 9 | lib/getopt.c 10 | lib/quotearg.c 11 | lib/spawn-pipe.c 12 | lib/w32spawn.h 13 | lib/wait-process.c 14 | lib/xalloc-die.c 15 | src/connect.c 16 | src/convert.c 17 | src/cookies.c 18 | src/ftp-ls.c 19 | src/ftp.c 20 | src/gnutls.c 21 | src/host.c 22 | src/html-url.c 23 | src/http.c 24 | src/init.c 25 | src/iri.c 26 | src/log.c 27 | src/main.c 28 | src/mswindows.c 29 | src/netrc.c 30 | src/openssl.c 31 | src/progress.c 32 | src/ptimer.c 33 | src/recur.c 34 | src/res.c 35 | src/retr.c 36 | src/spider.c 37 | src/url.c 38 | src/utils.c 39 | src/warc.c 40 | -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | # This catalog furthermore displays the text between the quotation marks in 24 | # bold face, assuming the VT100/XTerm escape sequences. 25 | # 26 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /po/stamp-po: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /src/DESCRIP_MODS.MMS: -------------------------------------------------------------------------------- 1 | # 21 September 2009. SMS. 2 | # 3 | # Wget 1.12 for VMS - MMS (or MMK) Object Module List File. 4 | # 5 | 6 | # This description file is included by other description files. It is 7 | # not intended to be used alone. Verify proper inclusion. 8 | 9 | .IFDEF INCL_DESCRIP_SRC 10 | .ELSE 11 | $$$$ THIS DESCRIPTION FILE IS NOT INTENDED TO BE USED THIS WAY. 12 | .ENDIF 13 | 14 | # Object library modules. 15 | 16 | MODS_OBJS_LIB_SRC_NOSSL = \ 17 | BUILD_INFO=[.$(DEST)]BUILD_INFO.OBJ \ 18 | CMPT=[.$(DEST)]CMPT.OBJ \ 19 | CONNECT=[.$(DEST)]CONNECT.OBJ \ 20 | CONVERT=[.$(DEST)]CONVERT.OBJ \ 21 | COOKIES=[.$(DEST)]COOKIES.OBJ \ 22 | CSS-URL=[.$(DEST)]CSS-URL.OBJ \ 23 | CSS=[.$(DEST)]CSS.OBJ \ 24 | EXITS=[.$(DEST)]EXITS.OBJ \ 25 | FTP-BASIC=[.$(DEST)]FTP-BASIC.OBJ \ 26 | FTP-LS=[.$(DEST)]FTP-LS.OBJ \ 27 | FTP-OPIE=[.$(DEST)]FTP-OPIE.OBJ \ 28 | FTP=[.$(DEST)]FTP.OBJ \ 29 | GEN-MD5=[.$(DEST)]GEN-MD5.OBJ \ 30 | HASH=[.$(DEST)]HASH.OBJ \ 31 | HOST=[.$(DEST)]HOST.OBJ \ 32 | HTML-PARSE=[.$(DEST)]HTML-PARSE.OBJ \ 33 | HTML-URL=[.$(DEST)]HTML-URL.OBJ \ 34 | HTTP-NTLM=[.$(DEST)]HTTP-NTLM.OBJ \ 35 | HTTP=[.$(DEST)]HTTP.OBJ \ 36 | INIT=[.$(DEST)]INIT.OBJ \ 37 | LOG=[.$(DEST)]LOG.OBJ \ 38 | MAIN=[.$(DEST)]MAIN.OBJ \ 39 | NETRC=[.$(DEST)]NETRC.OBJ \ 40 | PROGRESS=[.$(DEST)]PROGRESS.OBJ \ 41 | PTIMER=[.$(DEST)]PTIMER.OBJ \ 42 | RECUR=[.$(DEST)]RECUR.OBJ \ 43 | RES=[.$(DEST)]RES.OBJ \ 44 | RETR=[.$(DEST)]RETR.OBJ \ 45 | SNPRINTF=[.$(DEST)]SNPRINTF.OBJ \ 46 | SPIDER=[.$(DEST)]SPIDER.OBJ \ 47 | URL=[.$(DEST)]URL.OBJ \ 48 | UTILS=[.$(DEST)]UTILS.OBJ \ 49 | VMS=[.$(DEST)]VMS.OBJ \ 50 | 51 | .IFDEF CDEFS_SSL # CDEFS_SSL 52 | MODS_OBJS_LIB_SRC_SSL = \ 53 | OPENSSL=[.$(DEST)]OPENSSL.OBJ 54 | .ELSE # CDEFS_SSL 55 | MODS_OBJS_LIB_SRC_SSL = 56 | .ENDIF # CDEFS_SSL [else] 57 | 58 | MODS_OBJS_LIB_SRC = $(MODS_OBJS_LIB_SRC_NOSSL) $(MODS_OBJS_LIB_SRC_SSL) 59 | 60 | -------------------------------------------------------------------------------- /src/DESCRIP_SRC.MMS: -------------------------------------------------------------------------------- 1 | # 23 September 2009. SMS. 2 | # 3 | # Wget 1.12 for VMS - MMS (or MMK) Source Description File. 4 | # 5 | 6 | # Default target identifier. 7 | 8 | TARGET_SRC = 1 9 | 10 | # Common source description file. 11 | 12 | .INCLUDE [-.VMS]DESCRIP_SRC_CMN.MMS 13 | 14 | # C compiler defines. 15 | 16 | CDEFS_SPEC = 17 | 18 | CDEFS = $(CDEFS_CMN) $(CDEFS_SPEC) 19 | 20 | # Other C compiler options. 21 | 22 | CFLAGS_INCL = /include = ([], [.$(DEST)], \ 23 | [-.$(DIR_LIB)], [-.$(DIR_LIB).$(DEST)], [-.$(DIR_MD5)], [-.$(DIR_VMS)]) 24 | 25 | CFLAGS_SPEC = /prefix_library_entries = \ 26 | (all_entries, except = (utime $(UTNP))) 27 | 28 | # Define CFLAGS and LINKFLAGS. 29 | 30 | .INCLUDE [-.VMS]DESCRIP_SRC_FLAGS.MMS 31 | 32 | # Object library modules. 33 | 34 | .INCLUDE DESCRIP_MODS.MMS 35 | 36 | -------------------------------------------------------------------------------- /src/build_info.c.in: -------------------------------------------------------------------------------- 1 | digest defined ENABLE_DIGEST 2 | https defined HAVE_SSL 3 | ipv6 defined ENABLE_IPV6 4 | iri defined ENABLE_IRI 5 | large-file SIZEOF_OFF_T >= 8 6 | 7 | nls defined ENABLE_NLS 8 | ntlm defined ENABLE_NTLM 9 | opie defined ENABLE_OPIE 10 | 11 | ssl choice: 12 | openssl defined HAVE_LIBSSL || defined HAVE_LIBSSL32 13 | gnutls defined HAVE_LIBGNUTLS 14 | -------------------------------------------------------------------------------- /src/connect.h: -------------------------------------------------------------------------------- 1 | /* Declarations for connect. 2 | Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 | 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, 4 | Inc. 5 | 6 | This file is part of GNU Wget. 7 | 8 | GNU Wget is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | GNU Wget is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Wget. If not, see . 20 | 21 | Additional permission under GNU GPL version 3 section 7 22 | 23 | If you modify this program, or any covered work, by linking or 24 | combining it with the OpenSSL project's OpenSSL library (or a 25 | modified version of that library), containing parts covered by the 26 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 27 | grants you additional permission to convey the resulting work. 28 | Corresponding Source for a non-source form of such a combination 29 | shall include the source code for the parts of OpenSSL used as well 30 | as that of the covered work. */ 31 | 32 | #ifndef CONNECT_H 33 | #define CONNECT_H 34 | 35 | #include "host.h" /* for definition of ip_address */ 36 | 37 | /* Function declarations */ 38 | 39 | /* Returned by connect_to_host when host name cannot be resolved. */ 40 | enum { 41 | E_HOST = -100 42 | }; 43 | int connect_to_host (const char *, int); 44 | int connect_to_ip (const ip_address *, int, const char *); 45 | 46 | int bind_local (const ip_address *, int *); 47 | int accept_connection (int); 48 | 49 | enum { 50 | ENDPOINT_LOCAL, 51 | ENDPOINT_PEER 52 | }; 53 | bool socket_ip_address (int, ip_address *, int); 54 | int socket_family (int sock, int endpoint); 55 | 56 | bool retryable_socket_connect_error (int); 57 | 58 | /* Flags for select_fd's WAIT_FOR argument. */ 59 | enum { 60 | WAIT_FOR_READ = 1, 61 | WAIT_FOR_WRITE = 2 62 | }; 63 | int select_fd (int, double, int); 64 | bool test_socket_open (int); 65 | 66 | struct transport_implementation { 67 | int (*reader) (int, char *, int, void *); 68 | int (*writer) (int, char *, int, void *); 69 | int (*poller) (int, double, int, void *); 70 | int (*peeker) (int, char *, int, void *); 71 | const char *(*errstr) (int, void *); 72 | void (*closer) (int, void *); 73 | }; 74 | 75 | void fd_register_transport (int, struct transport_implementation *, void *); 76 | void *fd_transport_context (int); 77 | int fd_read (int, char *, int, double); 78 | int fd_write (int, char *, int, double); 79 | int fd_peek (int, char *, int, double); 80 | const char *fd_errstr (int); 81 | void fd_close (int); 82 | 83 | #endif /* CONNECT_H */ 84 | -------------------------------------------------------------------------------- /src/cookies.h: -------------------------------------------------------------------------------- 1 | /* Support for cookies. 2 | Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 3 | 2010, 2011 Free Software Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or (at 10 | your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, but 13 | WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef COOKIES_H 32 | #define COOKIES_H 33 | 34 | struct cookie_jar; 35 | 36 | struct cookie_jar *cookie_jar_new (void); 37 | void cookie_jar_delete (struct cookie_jar *); 38 | 39 | void cookie_handle_set_cookie (struct cookie_jar *, const char *, int, 40 | const char *, const char *); 41 | char *cookie_header (struct cookie_jar *, const char *, int, 42 | const char *, bool); 43 | 44 | void cookie_jar_load (struct cookie_jar *, const char *); 45 | void cookie_jar_save (struct cookie_jar *, const char *); 46 | 47 | #endif /* COOKIES_H */ 48 | -------------------------------------------------------------------------------- /src/css-tokens.h: -------------------------------------------------------------------------------- 1 | /* Declarations for css.lex 2 | Copyright (C) 2006, 2009, 2010, 2011 Free Software Foundation, Inc. 3 | 4 | This file is part of GNU Wget. 5 | 6 | GNU Wget is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or (at 9 | your option) any later version. 10 | 11 | GNU Wget is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Wget. If not, see . 18 | 19 | Additional permission under GNU GPL version 3 section 7 20 | 21 | If you modify this program, or any covered work, by linking or 22 | combining it with the OpenSSL project's OpenSSL library (or a 23 | modified version of that library), containing parts covered by the 24 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 25 | grants you additional permission to convey the resulting work. 26 | Corresponding Source for a non-source form of such a combination 27 | shall include the source code for the parts of OpenSSL used as well 28 | as that of the covered work. */ 29 | 30 | #ifndef CSS_TOKENS_H 31 | #define CSS_TOKENS_H 32 | 33 | enum { 34 | CSSEOF, 35 | S, 36 | CDO, 37 | CDC, 38 | INCLUDES, 39 | DASHMATCH, 40 | LBRACE, 41 | PLUS, 42 | GREATER, 43 | COMMA, 44 | STRING, 45 | INVALID, 46 | IDENT, 47 | HASH, 48 | IMPORT_SYM, 49 | PAGE_SYM, 50 | MEDIA_SYM, 51 | CHARSET_SYM, 52 | IMPORTANT_SYM, 53 | EMS, 54 | EXS, 55 | LENGTH, 56 | ANGLE, 57 | TIME, 58 | FREQ, 59 | DIMENSION, 60 | PERCENTAGE, 61 | NUMBER, 62 | URI, 63 | FUNCTION 64 | }; 65 | 66 | #endif /* CSS_TOKENS_H */ 67 | -------------------------------------------------------------------------------- /src/css-url.h: -------------------------------------------------------------------------------- 1 | /* Declarations for css-url.c. 2 | Copyright (C) 2006, 2009, 2010, 2011 Free Software Foundation, Inc. 3 | 4 | This file is part of GNU Wget. 5 | 6 | GNU Wget is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or (at 9 | your option) any later version. 10 | 11 | GNU Wget is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Wget. If not, see . 18 | 19 | Additional permission under GNU GPL version 3 section 7 20 | 21 | If you modify this program, or any covered work, by linking or 22 | combining it with the OpenSSL project's OpenSSL library (or a 23 | modified version of that library), containing parts covered by the 24 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 25 | grants you additional permission to convey the resulting work. 26 | Corresponding Source for a non-source form of such a combination 27 | shall include the source code for the parts of OpenSSL used as well 28 | as that of the covered work. */ 29 | 30 | #ifndef CSS_URL_H 31 | #define CSS_URL_H 32 | 33 | void get_urls_css (struct map_context *, int, int); 34 | void get_urls_css (struct map_context *, int, int); 35 | struct urlpos *get_urls_css_file (const char *, const char *); 36 | 37 | #endif /* CSS_URL_H */ 38 | -------------------------------------------------------------------------------- /src/decc_ver.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main( void) 4 | { 5 | #ifdef __VMS_VERSION 6 | printf( " __VMS_VERSION: >%s<.\n", __VMS_VERSION); 7 | #else /* def __VMS_VERSION */ 8 | printf( " __VMS_VERSION: (undefined)<.\n"); 9 | #endif /* def __VMS_VERSION [else] */ 10 | 11 | #ifdef __VMS_VER 12 | printf( " __VMS_VER = %d.\n", __VMS_VER); 13 | #else /* def __VMS_VER */ 14 | printf( " __VMS_VER = (undefined).\n"); 15 | #endif /* def __VMS_VER [else] */ 16 | 17 | #ifdef __DECC_VER 18 | printf( " __DECC_VER = %d.\n", __DECC_VER); 19 | #else /* def __DECC_VER */ 20 | printf( " __DECC_VER = (undefined).\n"); 21 | #endif /* def __DECC_VER */ 22 | 23 | #ifdef __CRTL_VER 24 | printf( " __CRTL_VER = %d.\n", __CRTL_VER); 25 | #else /* def __CRTL_VER */ 26 | printf( " __CRTL_VER = (undefined).\n"); 27 | #endif /* def __CRTL_VER */ 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /src/exits.h: -------------------------------------------------------------------------------- 1 | /* Exit status related declarations. 2 | Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. 3 | 4 | This file is part of GNU Wget. 5 | 6 | GNU Wget is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GNU Wget is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Wget. If not, see . */ 18 | 19 | #ifndef WGET_EXITS_H 20 | #define WGET_EXITS_H 21 | 22 | #include "wget.h" 23 | 24 | 25 | void inform_exit_status (uerr_t err); 26 | 27 | int get_exit_status (void); 28 | 29 | 30 | #endif /* WGET_EXITS_H */ 31 | -------------------------------------------------------------------------------- /src/hash.h: -------------------------------------------------------------------------------- 1 | /* Hash table declarations. 2 | Copyright (C) 2000, 2007, 2008, 2009, 2010, 2011 Free Software 3 | Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef HASH_H 32 | #define HASH_H 33 | 34 | struct hash_table; 35 | 36 | struct hash_table *hash_table_new (int, unsigned long (*) (const void *), 37 | int (*) (const void *, const void *)); 38 | void hash_table_destroy (struct hash_table *); 39 | 40 | void *hash_table_get (const struct hash_table *, const void *); 41 | int hash_table_get_pair (const struct hash_table *, const void *, 42 | void *, void *); 43 | int hash_table_contains (const struct hash_table *, const void *); 44 | 45 | void hash_table_put (struct hash_table *, const void *, const void *); 46 | int hash_table_remove (struct hash_table *, const void *); 47 | void hash_table_clear (struct hash_table *); 48 | 49 | void hash_table_for_each (struct hash_table *, 50 | int (*) (void *, void *, void *), void *); 51 | 52 | typedef struct { 53 | void *key, *value; /* public members */ 54 | void *pos, *end; /* private members */ 55 | } hash_table_iterator; 56 | void hash_table_iterate (struct hash_table *, hash_table_iterator *); 57 | int hash_table_iter_next (hash_table_iterator *); 58 | 59 | int hash_table_count (const struct hash_table *); 60 | 61 | struct hash_table *make_string_hash_table (int); 62 | struct hash_table *make_nocase_string_hash_table (int); 63 | 64 | unsigned long hash_pointer (const void *); 65 | 66 | #endif /* HASH_H */ 67 | -------------------------------------------------------------------------------- /src/html-parse.h: -------------------------------------------------------------------------------- 1 | /* Declarations for html-parse.c. 2 | Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 3 | 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef HTML_PARSE_H 32 | #define HTML_PARSE_H 33 | 34 | struct attr_pair { 35 | char *name; /* attribute name */ 36 | char *value; /* attribute value */ 37 | 38 | /* Needed for URL conversion; the places where the value begins and 39 | ends, including the quotes and everything. */ 40 | const char *value_raw_beginning; 41 | int value_raw_size; 42 | 43 | /* Used internally by map_html_tags. */ 44 | int name_pool_index, value_pool_index; 45 | }; 46 | 47 | struct taginfo { 48 | char *name; /* tag name */ 49 | int end_tag_p; /* whether this is an end-tag */ 50 | int nattrs; /* number of attributes */ 51 | struct attr_pair *attrs; /* attributes */ 52 | 53 | const char *start_position; /* start position of tag */ 54 | const char *end_position; /* end position of tag */ 55 | 56 | const char *contents_begin; /* delimiters of tag contents */ 57 | const char *contents_end; /* only valid if end_tag_p */ 58 | }; 59 | 60 | struct hash_table; /* forward declaration */ 61 | 62 | /* Flags for map_html_tags: */ 63 | #define MHT_STRICT_COMMENTS 1 /* use strict comment interpretation */ 64 | #define MHT_TRIM_VALUES 2 /* trim attribute values, e.g. interpret 65 | as "foo" */ 66 | 67 | void map_html_tags (const char *, int, 68 | void (*) (struct taginfo *, void *), void *, int, 69 | const struct hash_table *, const struct hash_table *); 70 | 71 | #endif /* HTML_PARSE_H */ 72 | -------------------------------------------------------------------------------- /src/html-url.h: -------------------------------------------------------------------------------- 1 | /* Declarations for html-url.c. 2 | Copyright (C) 1995, 1996, 1997, 2009, 2010, 2011 Free Software 3 | Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or (at 10 | your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef HTML_URL_H 32 | #define HTML_URL_H 33 | 34 | struct map_context { 35 | char *text; /* HTML text. */ 36 | char *base; /* Base URI of the document, possibly 37 | changed through . */ 38 | const char *parent_base; /* Base of the current document. */ 39 | const char *document_file; /* File name of this document. */ 40 | bool nofollow; /* whether NOFOLLOW was specified in a 41 | tag. */ 42 | 43 | struct urlpos *head; /* List of URLs that is being built. */ 44 | }; 45 | 46 | struct urlpos *get_urls_file (const char *); 47 | struct urlpos *get_urls_html (const char *, const char *, bool *, struct iri *); 48 | struct urlpos *append_url (const char *, int, int, struct map_context *); 49 | void free_urlpos (struct urlpos *); 50 | 51 | #endif /* HTML_URL_H */ 52 | -------------------------------------------------------------------------------- /src/http-ntlm.h: -------------------------------------------------------------------------------- 1 | #ifndef __HTTP_NTLM_H 2 | #define __HTTP_NTLM_H 3 | /* Declarations for http_ntlm.c 4 | Copyright (C) 1995, 1996, 1997, 2000, 2007, 2008, 2009, 2010, 2011 5 | Free Software Foundation, Inc. 6 | Contributed by Daniel Stenberg. 7 | 8 | This file is part of GNU Wget. 9 | 10 | GNU Wget is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | GNU Wget is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with Wget. If not, see . 22 | 23 | Additional permission under GNU GPL version 3 section 7 24 | 25 | If you modify this program, or any covered work, by linking or 26 | combining it with the OpenSSL project's OpenSSL library (or a 27 | modified version of that library), containing parts covered by the 28 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 29 | grants you additional permission to convey the resulting work. 30 | Corresponding Source for a non-source form of such a combination 31 | shall include the source code for the parts of OpenSSL used as well 32 | as that of the covered work. */ 33 | 34 | typedef enum { 35 | NTLMSTATE_NONE, 36 | NTLMSTATE_TYPE1, 37 | NTLMSTATE_TYPE2, 38 | NTLMSTATE_TYPE3, 39 | NTLMSTATE_LAST 40 | } wgetntlm; 41 | 42 | /* Struct used for NTLM challenge-response authentication */ 43 | struct ntlmdata { 44 | wgetntlm state; 45 | unsigned char nonce[8]; 46 | }; 47 | 48 | /* this is for ntlm header input */ 49 | bool ntlm_input (struct ntlmdata *, const char *); 50 | 51 | /* this is for creating ntlm header output */ 52 | char *ntlm_output (struct ntlmdata *, const char *, const char *, bool *); 53 | #endif 54 | -------------------------------------------------------------------------------- /src/http.h: -------------------------------------------------------------------------------- 1 | /* Declarations for HTTP. 2 | Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 3 | Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef HTTP_H 32 | #define HTTP_H 33 | 34 | struct url; 35 | 36 | uerr_t http_loop (struct url *, struct url *, char **, char **, const char *, 37 | int *, struct url *, struct iri *); 38 | void save_cookies (void); 39 | void http_cleanup (void); 40 | time_t http_atotm (const char *); 41 | 42 | typedef struct { 43 | /* A token consists of characters in the [b, e) range. */ 44 | const char *b, *e; 45 | } param_token; 46 | bool extract_param (const char **, param_token *, param_token *, char); 47 | 48 | 49 | #endif /* HTTP_H */ 50 | -------------------------------------------------------------------------------- /src/init.h: -------------------------------------------------------------------------------- 1 | /* Declarations for init.c. 2 | Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 | 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, 4 | Inc. 5 | 6 | This file is part of GNU Wget. 7 | 8 | GNU Wget is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | GNU Wget is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Wget. If not, see . 20 | 21 | Additional permission under GNU GPL version 3 section 7 22 | 23 | If you modify this program, or any covered work, by linking or 24 | combining it with the OpenSSL project's OpenSSL library (or a 25 | modified version of that library), containing parts covered by the 26 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 27 | grants you additional permission to convey the resulting work. 28 | Corresponding Source for a non-source form of such a combination 29 | shall include the source code for the parts of OpenSSL used as well 30 | as that of the covered work. */ 31 | 32 | #ifndef INIT_H 33 | #define INIT_H 34 | 35 | char *wgetrc_env_file_name (void); 36 | char *wgetrc_user_file_name (void); 37 | char *wgetrc_file_name (void); 38 | void initialize (void); 39 | void run_command (const char *); 40 | void setoptval (const char *, const char *, const char *); 41 | char *home_dir (void); 42 | void cleanup (void); 43 | void defaults (void); 44 | bool run_wgetrc (const char *file); 45 | 46 | #endif /* INIT_H */ 47 | -------------------------------------------------------------------------------- /src/iri.h: -------------------------------------------------------------------------------- 1 | /* Internationalization related declarations. 2 | Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 3 | 4 | This file is part of GNU Wget. 5 | 6 | GNU Wget is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | GNU Wget is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with Wget. If not, see . 18 | 19 | Additional permission under GNU GPL version 3 section 7 20 | 21 | If you modify this program, or any covered work, by linking or 22 | combining it with the OpenSSL project's OpenSSL library (or a 23 | modified version of that library), containing parts covered by the 24 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 25 | grants you additional permission to convey the resulting work. 26 | Corresponding Source for a non-source form of such a combination 27 | shall include the source code for the parts of OpenSSL used as well 28 | as that of the covered work. */ 29 | 30 | #ifndef IRI_H 31 | #define IRI_H 32 | 33 | struct iri { 34 | char *uri_encoding; /* Encoding of the uri to fetch */ 35 | char *content_encoding; /* Encoding of links inside the fetched file */ 36 | char *orig_url; /* */ 37 | bool utf8_encode; /* Will/Is the current url encoded in utf8 */ 38 | }; 39 | 40 | #ifdef ENABLE_IRI 41 | 42 | char *parse_charset (char *str); 43 | char *find_locale (void); 44 | bool check_encoding_name (char *encoding); 45 | const char *locale_to_utf8 (const char *str); 46 | char *idn_encode (struct iri *i, char *host); 47 | char *idn_decode (char *host); 48 | bool remote_to_utf8 (struct iri *i, const char *str, const char **new); 49 | struct iri *iri_new (void); 50 | struct iri *iri_dup (const struct iri *); 51 | void iri_free (struct iri *i); 52 | void set_uri_encoding (struct iri *i, char *charset, bool force); 53 | void set_content_encoding (struct iri *i, char *charset); 54 | 55 | #else /* ENABLE_IRI */ 56 | 57 | extern struct iri dummy_iri; 58 | 59 | #define parse_charset(str) (str, NULL) 60 | #define find_locale() NULL 61 | #define check_encoding_name(str) false 62 | #define locale_to_utf8(str) (str) 63 | #define idn_encode(a,b) NULL 64 | #define idn_decode(str) NULL 65 | #define remote_to_utf8(a,b,c) false 66 | #define iri_new() (&dummy_iri) 67 | #define iri_dup(a) (&dummy_iri) 68 | #define iri_free(a) 69 | #define set_uri_encoding(a,b,c) 70 | #define set_content_encoding(a,b) 71 | 72 | #endif /* ENABLE_IRI */ 73 | #endif /* IRI_H */ 74 | -------------------------------------------------------------------------------- /src/log.h: -------------------------------------------------------------------------------- 1 | /* Declarations for log.c. 2 | Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 3 | 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef LOG_H 32 | #define LOG_H 33 | 34 | /* The log file to which Wget writes to after HUP. */ 35 | #define DEFAULT_LOGFILE "wget-log" 36 | 37 | #include 38 | 39 | enum log_options { LOG_VERBOSE, LOG_NOTQUIET, LOG_NONVERBOSE, LOG_ALWAYS }; 40 | 41 | void log_set_warc_log_fp (FILE *); 42 | 43 | void logprintf (enum log_options, const char *, ...) 44 | GCC_FORMAT_ATTR (2, 3); 45 | void debug_logprintf (const char *, ...) GCC_FORMAT_ATTR (1, 2); 46 | void logputs (enum log_options, const char *); 47 | void logflush (void); 48 | void log_set_flush (bool); 49 | bool log_set_save_context (bool); 50 | 51 | void log_init (const char *, bool); 52 | void log_close (void); 53 | void log_cleanup (void); 54 | void log_request_redirect_output (const char *); 55 | 56 | const char *escnonprint (const char *); 57 | const char *escnonprint_uri (const char *); 58 | 59 | #endif /* LOG_H */ 60 | -------------------------------------------------------------------------------- /src/netrc.h: -------------------------------------------------------------------------------- 1 | /* Declarations for netrc.c 2 | Copyright (C) 1996, 1996, 1997, 2007, 2008, 2009, 2010, 2011 Free 3 | Software Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef NETRC_H 32 | #define NETRC_H 33 | 34 | typedef struct _acc_t 35 | { 36 | char *host; /* NULL if this is the default machine 37 | entry. */ 38 | char *acc; 39 | char *passwd; /* NULL if there is no password. */ 40 | struct _acc_t *next; 41 | } acc_t; 42 | 43 | void search_netrc (const char *, const char **, const char **, int); 44 | void free_netrc (acc_t *l); 45 | 46 | #endif /* NETRC_H */ 47 | -------------------------------------------------------------------------------- /src/progress.h: -------------------------------------------------------------------------------- 1 | /* Download progress. 2 | Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 3 | 2010, 2011 Free Software Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | \(at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef PROGRESS_H 32 | #define PROGRESS_H 33 | 34 | bool valid_progress_implementation_p (const char *); 35 | void set_progress_implementation (const char *); 36 | void progress_schedule_redirect (void); 37 | 38 | void *progress_create (wgint, wgint); 39 | bool progress_interactive_p (void *); 40 | void progress_update (void *, wgint, double); 41 | void progress_finish (void *, double); 42 | 43 | void progress_handle_sigwinch (int); 44 | 45 | #endif /* PROGRESS_H */ 46 | -------------------------------------------------------------------------------- /src/ptimer.h: -------------------------------------------------------------------------------- 1 | /* Declarations for ptimer.c. 2 | Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 3 | Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef PTIMER_H 32 | #define PTIMER_H 33 | 34 | struct ptimer; /* forward declaration; all struct 35 | members are private */ 36 | 37 | struct ptimer *ptimer_new (void); 38 | void ptimer_destroy (struct ptimer *); 39 | 40 | void ptimer_reset (struct ptimer *); 41 | double ptimer_measure (struct ptimer *); 42 | double ptimer_read (const struct ptimer *); 43 | 44 | double ptimer_resolution (void); 45 | 46 | #endif /* PTIMER_H */ 47 | -------------------------------------------------------------------------------- /src/recur.h: -------------------------------------------------------------------------------- 1 | /* Declarations for recur.c. 2 | Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 | 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, 4 | Inc. 5 | 6 | This file is part of GNU Wget. 7 | 8 | GNU Wget is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | GNU Wget is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Wget. If not, see . 20 | 21 | Additional permission under GNU GPL version 3 section 7 22 | 23 | If you modify this program, or any covered work, by linking or 24 | combining it with the OpenSSL project's OpenSSL library (or a 25 | modified version of that library), containing parts covered by the 26 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 27 | grants you additional permission to convey the resulting work. 28 | Corresponding Source for a non-source form of such a combination 29 | shall include the source code for the parts of OpenSSL used as well 30 | as that of the covered work. */ 31 | 32 | #ifndef RECUR_H 33 | #define RECUR_H 34 | 35 | #include "url.h" 36 | 37 | /* For most options, 0 means no limits, but with -p in the picture, 38 | that causes a problem on the maximum recursion depth variable. To 39 | retain backwards compatibility we allow users to consider "0" to be 40 | synonymous with "inf" for -l, but internally infinite recursion is 41 | specified by -1 and 0 means to only retrieve the requisites of a 42 | single document. */ 43 | #define INFINITE_RECURSION -1 44 | 45 | struct urlpos; 46 | 47 | void recursive_cleanup (void); 48 | uerr_t retrieve_tree (struct url *, struct iri *); 49 | 50 | #endif /* RECUR_H */ 51 | -------------------------------------------------------------------------------- /src/res.h: -------------------------------------------------------------------------------- 1 | /* Declarations for res.c. 2 | Copyright (C) 2001, 2007, 2008, 2009, 2010, 2011 Free Software 3 | Foundation, Inc. 4 | 5 | This file is part of Wget. 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef RES_H 32 | #define RES_H 33 | 34 | struct robot_specs; 35 | 36 | struct robot_specs *res_parse (const char *, int); 37 | struct robot_specs *res_parse_from_file (const char *); 38 | 39 | bool res_match_path (const struct robot_specs *, const char *); 40 | 41 | void res_register_specs (const char *, int, struct robot_specs *); 42 | struct robot_specs *res_get_specs (const char *, int); 43 | 44 | bool res_retrieve_file (const char *, char **, struct iri *); 45 | 46 | bool is_robots_txt_url (const char *); 47 | 48 | void res_cleanup (void); 49 | 50 | #endif /* RES_H */ 51 | -------------------------------------------------------------------------------- /src/retr.h: -------------------------------------------------------------------------------- 1 | /* Declarations for retr.c. 2 | Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3 | 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, 4 | Inc. 5 | 6 | This file is part of GNU Wget. 7 | 8 | GNU Wget is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | GNU Wget is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Wget. If not, see . 20 | 21 | Additional permission under GNU GPL version 3 section 7 22 | 23 | If you modify this program, or any covered work, by linking or 24 | combining it with the OpenSSL project's OpenSSL library (or a 25 | modified version of that library), containing parts covered by the 26 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 27 | grants you additional permission to convey the resulting work. 28 | Corresponding Source for a non-source form of such a combination 29 | shall include the source code for the parts of OpenSSL used as well 30 | as that of the covered work. */ 31 | 32 | #ifndef RETR_H 33 | #define RETR_H 34 | 35 | #include "url.h" 36 | 37 | /* These global vars should be made static to retr.c and exported via 38 | functions! */ 39 | extern SUM_SIZE_INT total_downloaded_bytes; 40 | extern double total_download_time; 41 | extern FILE *output_stream; 42 | extern bool output_stream_regular; 43 | 44 | /* Flags for fd_read_body. */ 45 | enum { 46 | rb_read_exactly = 1, 47 | rb_skip_startpos = 2, 48 | 49 | /* Used by HTTP/HTTPS*/ 50 | rb_chunked_transfer_encoding = 4 51 | }; 52 | 53 | int fd_read_body (int, FILE *, wgint, wgint, wgint *, wgint *, double *, int, FILE *); 54 | 55 | typedef const char *(*hunk_terminator_t) (const char *, const char *, int); 56 | 57 | char *fd_read_hunk (int, hunk_terminator_t, long, long); 58 | char *fd_read_line (int); 59 | 60 | uerr_t retrieve_url (struct url *, const char *, char **, char **, 61 | const char *, int *, bool, struct iri *, bool); 62 | uerr_t retrieve_from_file (const char *, bool, int *); 63 | 64 | const char *retr_rate (wgint, double); 65 | double calc_rate (wgint, double, int *); 66 | void printwhat (int, int); 67 | 68 | void sleep_between_retrievals (int); 69 | 70 | void rotate_backups (const char *); 71 | 72 | bool url_uses_proxy (struct url *); 73 | 74 | void set_local_file (const char **, const char *); 75 | 76 | bool input_file_url (const char *); 77 | 78 | #endif /* RETR_H */ 79 | -------------------------------------------------------------------------------- /src/spider.h: -------------------------------------------------------------------------------- 1 | /* Declarations for spider.c 2 | Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Free Software 3 | Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef SPIDER_H 32 | #define SPIDER_H 33 | 34 | #define visited_url(a,b) 35 | void nonexisting_url (const char *); 36 | void print_broken_links (void); 37 | 38 | #endif /* SPIDER_H */ 39 | -------------------------------------------------------------------------------- /src/ssl.h: -------------------------------------------------------------------------------- 1 | /* SSL support. 2 | Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 3 | 2009, 2010, 2011, 2012 Free Software Foundation, Inc. 4 | Originally contributed by Christian Fraenkel. 5 | 6 | This file is part of GNU Wget. 7 | 8 | GNU Wget is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | GNU Wget is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License along 19 | with Wget. If not, see . 20 | 21 | Additional permission under GNU GPL version 3 section 7 22 | 23 | If you modify this program, or any covered work, by linking or 24 | combining it with the OpenSSL project's OpenSSL library (or a 25 | modified version of that library), containing parts covered by the 26 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 27 | grants you additional permission to convey the resulting work. 28 | Corresponding Source for a non-source form of such a combination 29 | shall include the source code for the parts of OpenSSL used as well 30 | as that of the covered work. */ 31 | 32 | #ifndef GEN_SSLFUNC_H 33 | #define GEN_SSLFUNC_H 34 | 35 | bool ssl_init (void); 36 | bool ssl_connect_wget (int, const char *); 37 | bool ssl_check_certificate (int, const char *); 38 | 39 | #endif /* GEN_SSLFUNC_H */ 40 | -------------------------------------------------------------------------------- /src/test.h: -------------------------------------------------------------------------------- 1 | /* Unit testing declarations. 2 | Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 3 | Foundation, Inc. 4 | 5 | This file is part of GNU Wget. 6 | 7 | GNU Wget is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | GNU Wget is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Wget. If not, see . 19 | 20 | Additional permission under GNU GPL version 3 section 7 21 | 22 | If you modify this program, or any covered work, by linking or 23 | combining it with the OpenSSL project's OpenSSL library (or a 24 | modified version of that library), containing parts covered by the 25 | terms of the OpenSSL or SSLeay licenses, the Free Software Foundation 26 | grants you additional permission to convey the resulting work. 27 | Corresponding Source for a non-source form of such a combination 28 | shall include the source code for the parts of OpenSSL used as well 29 | as that of the covered work. */ 30 | 31 | #ifndef TEST_H 32 | #define TEST_H 33 | 34 | /* from MinUnit */ 35 | #define mu_assert(message, test) do { if (!(test)) return message; } while (0) 36 | #define mu_run_test(test) \ 37 | do { \ 38 | const char *message; \ 39 | puts("RUNNING TEST " #test "..."); \ 40 | message = test(); \ 41 | tests_run++; \ 42 | if (message) return message; \ 43 | puts("PASSED\n"); \ 44 | } while (0) 45 | 46 | extern int tests_run; 47 | 48 | #endif /* TEST_H */ 49 | 50 | /* 51 | * vim: et ts=2 sw=2 52 | */ 53 | 54 | -------------------------------------------------------------------------------- /src/warc.h: -------------------------------------------------------------------------------- 1 | /* Declarations of WARC helper methods. */ 2 | #ifndef WARC_H 3 | #define WARC_H 4 | 5 | #include "host.h" 6 | 7 | void warc_init (void); 8 | void warc_close (void); 9 | void warc_timestamp (char *timestamp); 10 | void warc_uuid_str (char *id_str); 11 | 12 | FILE * warc_tempfile (void); 13 | 14 | bool warc_write_request_record (char *url, char *timestamp_str, 15 | char *concurrent_to_uuid, ip_address *ip, FILE *body, off_t payload_offset); 16 | bool warc_write_response_record (char *url, char *timestamp_str, 17 | char *concurrent_to_uuid, ip_address *ip, FILE *body, off_t payload_offset, 18 | char *mime_type, int response_code, char *redirect_location); 19 | bool warc_write_resource_record (char *resource_uuid, const char *url, 20 | const char *timestamp_str, const char *concurrent_to_uuid, ip_address *ip, 21 | const char *content_type, FILE *body, off_t payload_offset); 22 | bool warc_write_metadata_record (char *record_uuid, const char *url, 23 | const char *timestamp_str, const char *concurrent_to_uuid, ip_address *ip, 24 | const char *content_type, FILE *body, off_t payload_offset); 25 | 26 | #endif /* WARC_H */ 27 | -------------------------------------------------------------------------------- /tests/FTPTest.pm: -------------------------------------------------------------------------------- 1 | package FTPTest; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use FTPServer; 7 | use WgetTest; 8 | 9 | our @ISA = qw(WgetTest); 10 | my $VERSION = 0.01; 11 | 12 | 13 | { 14 | my %_attr_data = ( # DEFAULT 15 | ); 16 | 17 | sub _default_for 18 | { 19 | my ($self, $attr) = @_; 20 | return $_attr_data{$attr} if exists $_attr_data{$attr}; 21 | return $self->SUPER::_default_for($attr); 22 | } 23 | 24 | sub _standard_keys 25 | { 26 | my ($self) = @_; 27 | ($self->SUPER::_standard_keys(), keys %_attr_data); 28 | } 29 | } 30 | 31 | 32 | sub _setup_server { 33 | my $self = shift; 34 | 35 | $self->{_server} = FTPServer->new (input => $self->{_input}, 36 | server_behavior => 37 | $self->{_server_behavior}, 38 | LocalAddr => 'localhost', 39 | ReuseAddr => 1, 40 | rootDir => "$self->{_workdir}/$self->{_name}/input") or die "Cannot create server!!!"; 41 | } 42 | 43 | 44 | sub _launch_server { 45 | my $self = shift; 46 | my $synch_func = shift; 47 | 48 | $self->{_server}->run ($synch_func); 49 | } 50 | 51 | sub _substitute_port { 52 | my $self = shift; 53 | my $ret = shift; 54 | $ret =~ s/{{port}}/$self->{_server}->sockport/eg; 55 | return $ret; 56 | } 57 | 58 | 1; 59 | 60 | # vim: et ts=4 sw=4 61 | 62 | -------------------------------------------------------------------------------- /tests/HTTPTest.pm: -------------------------------------------------------------------------------- 1 | package HTTPTest; 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPServer; 7 | use WgetTest; 8 | 9 | our @ISA = qw(WgetTest); 10 | my $VERSION = 0.01; 11 | 12 | 13 | { 14 | my %_attr_data = ( # DEFAULT 15 | ); 16 | 17 | sub _default_for 18 | { 19 | my ($self, $attr) = @_; 20 | return $_attr_data{$attr} if exists $_attr_data{$attr}; 21 | return $self->SUPER::_default_for($attr); 22 | } 23 | 24 | sub _standard_keys 25 | { 26 | my ($self) = @_; 27 | ($self->SUPER::_standard_keys(), keys %_attr_data); 28 | } 29 | } 30 | 31 | 32 | sub _setup_server { 33 | my $self = shift; 34 | $self->{_server} = HTTPServer->new (LocalAddr => 'localhost', 35 | ReuseAddr => 1) 36 | or die "Cannot create server!!!"; 37 | } 38 | 39 | 40 | sub _launch_server { 41 | my $self = shift; 42 | my $synch_func = shift; 43 | 44 | $self->{_server}->run ($self->{_input}, $synch_func); 45 | } 46 | 47 | sub _substitute_port { 48 | my $self = shift; 49 | my $ret = shift; 50 | $ret =~ s/{{port}}/$self->{_server}->sockport/eg; 51 | return $ret; 52 | } 53 | 54 | 1; 55 | 56 | # vim: et ts=4 sw=4 57 | 58 | -------------------------------------------------------------------------------- /tests/Test--httpsonly-r.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Main Page 15 | 16 | 17 |

18 | Some text and a link to a second page. 19 |

20 | 21 | 22 | EOF 23 | 24 | my $secondpage = < 26 | 27 | Second Page 28 | 29 | 30 |

31 | Anything. 32 |

33 | 34 | 35 | EOF 36 | 37 | # code, msg, headers, content 38 | my %urls = ( 39 | '/index.html' => { 40 | code => "200", 41 | msg => "Dontcare", 42 | headers => { 43 | "Content-type" => "text/html", 44 | }, 45 | content => $mainpage, 46 | }, 47 | '/secondpage.html' => { 48 | code => "200", 49 | msg => "Dontcare", 50 | headers => { 51 | "Content-type" => "text/html", 52 | }, 53 | content => $secondpage, 54 | } 55 | ); 56 | 57 | my $cmdline = $WgetTest::WGETPATH . " --https-only -r -nH http://localhost:{{port}}/"; 58 | 59 | my $expected_error_code = 0; 60 | 61 | my %expected_downloaded_files = ( 62 | 'index.html' => { 63 | content => $mainpage, 64 | }, 65 | ); 66 | 67 | ############################################################################### 68 | 69 | my $the_test = HTTPTest->new (name => "Test--httpsonly-r", 70 | input => \%urls, 71 | cmdline => $cmdline, 72 | errcode => $expected_error_code, 73 | output => \%expected_downloaded_files); 74 | print $expected_error_code."\n"; 75 | 76 | exit $the_test->run(); 77 | 78 | # vim: et ts=4 sw=4 79 | 80 | -------------------------------------------------------------------------------- /tests/Test--no-content-disposition-trivial.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < 13 | 14 | Page Title 15 | 16 | 17 |

18 | Some text. 19 |

20 | 21 | 22 | EOF 23 | 24 | # code, msg, headers, content 25 | my %urls = ( 26 | '/dummy.html' => { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/html", 31 | }, 32 | content => $dummyfile, 33 | }, 34 | ); 35 | 36 | my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:{{port}}/dummy.html"; 37 | 38 | my $expected_error_code = 0; 39 | 40 | my %expected_downloaded_files = ( 41 | 'dummy.html' => { 42 | content => $dummyfile, 43 | } 44 | ); 45 | 46 | ############################################################################### 47 | 48 | my $the_test = HTTPTest->new (name => "Test--no-content-disposition-trivial", 49 | input => \%urls, 50 | cmdline => $cmdline, 51 | errcode => $expected_error_code, 52 | output => \%expected_downloaded_files); 53 | exit $the_test->run(); 54 | 55 | # vim: et ts=4 sw=4 56 | 57 | -------------------------------------------------------------------------------- /tests/Test--no-content-disposition.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < 13 | 14 | Page Title 15 | 16 | 17 |

18 | Some text. 19 |

20 | 21 | 22 | EOF 23 | 24 | # code, msg, headers, content 25 | my %urls = ( 26 | '/dummy.html' => { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/html", 31 | "Content-Disposition" => "attachment; filename=\"filename.html\"", 32 | }, 33 | content => $dummyfile, 34 | }, 35 | ); 36 | 37 | my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:{{port}}/dummy.html"; 38 | 39 | my $expected_error_code = 0; 40 | 41 | my %expected_downloaded_files = ( 42 | 'dummy.html' => { 43 | content => $dummyfile, 44 | } 45 | ); 46 | 47 | ############################################################################### 48 | 49 | my $the_test = HTTPTest->new (name => "Test--no-content-disposition", 50 | input => \%urls, 51 | cmdline => $cmdline, 52 | errcode => $expected_error_code, 53 | output => \%expected_downloaded_files); 54 | exit $the_test->run(); 55 | 56 | # vim: et ts=4 sw=4 57 | 58 | -------------------------------------------------------------------------------- /tests/Test--post-file.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $cmdline = $WgetTest::WGETPATH . " --post-file=nofile http://localhost:{{port}}/"; 12 | 13 | my $expected_error_code = 3; 14 | 15 | 16 | ############################################################################### 17 | 18 | my $the_test = HTTPTest->new (name => "Test-missing-file", 19 | cmdline => $cmdline, 20 | errcode => $expected_error_code); 21 | exit $the_test->run(); 22 | 23 | # vim: et ts=4 sw=4 24 | -------------------------------------------------------------------------------- /tests/Test--spider-fail.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Main Page 15 | 16 | 17 |

18 | Some text. 19 |

20 | 21 | 22 | EOF 23 | 24 | # code, msg, headers, content 25 | my %urls = ( 26 | '/index.html' => { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/html", 31 | }, 32 | content => $mainpage, 33 | }, 34 | ); 35 | 36 | my $cmdline = $WgetTest::WGETPATH . " --spider http://localhost:{{port}}/nonexistent"; 37 | 38 | my $expected_error_code = 8; 39 | 40 | my %expected_downloaded_files = ( 41 | ); 42 | 43 | ############################################################################### 44 | 45 | my $the_test = HTTPTest->new (name => "Test--spider-fail", 46 | input => \%urls, 47 | cmdline => $cmdline, 48 | errcode => $expected_error_code, 49 | output => \%expected_downloaded_files); 50 | exit $the_test->run(); 51 | 52 | # vim: et ts=4 sw=4 53 | 54 | -------------------------------------------------------------------------------- /tests/Test--spider-r.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Main Page 15 | 16 | 17 |

18 | Some text and a link to a second page. 19 | Also, a broken link. 20 |

21 | 22 | 23 | EOF 24 | 25 | my $secondpage = < 27 | 28 | Second Page 29 | 30 | 31 |

32 | Some text and a link to a third page. 33 | Also, a broken link. 34 |

35 | 36 | 37 | EOF 38 | 39 | my $thirdpage = < 41 | 42 | Third Page 43 | 44 | 45 |

46 | Some text and a link to a text file. 47 | Also, another broken link. 48 |

49 | 50 | 51 | EOF 52 | 53 | my $dummyfile = < { 60 | code => "200", 61 | msg => "Dontcare", 62 | headers => { 63 | "Content-type" => "text/html", 64 | }, 65 | content => $mainpage, 66 | }, 67 | '/secondpage.html' => { 68 | code => "200", 69 | msg => "Dontcare", 70 | headers => { 71 | "Content-type" => "text/html", 72 | }, 73 | content => $secondpage, 74 | }, 75 | '/thirdpage.html' => { 76 | code => "200", 77 | msg => "Dontcare", 78 | headers => { 79 | "Content-type" => "text/html", 80 | }, 81 | content => $thirdpage, 82 | }, 83 | '/dummy.txt' => { 84 | code => "200", 85 | msg => "Dontcare", 86 | headers => { 87 | "Content-type" => "text/plain", 88 | }, 89 | content => $dummyfile 90 | }, 91 | ); 92 | 93 | my $cmdline = $WgetTest::WGETPATH . " --spider -r http://localhost:{{port}}/"; 94 | 95 | my $expected_error_code = 8; 96 | 97 | my %expected_downloaded_files = ( 98 | ); 99 | 100 | ############################################################################### 101 | 102 | my $the_test = HTTPTest->new (name => "Test--spider-r", 103 | input => \%urls, 104 | cmdline => $cmdline, 105 | errcode => $expected_error_code, 106 | output => \%expected_downloaded_files); 107 | exit $the_test->run(); 108 | 109 | # vim: et ts=4 sw=4 110 | 111 | -------------------------------------------------------------------------------- /tests/Test--spider.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Main Page 15 | 16 | 17 |

18 | Some text. 19 |

20 | 21 | 22 | EOF 23 | 24 | # code, msg, headers, content 25 | my %urls = ( 26 | '/index.html' => { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/html", 31 | }, 32 | content => $mainpage, 33 | }, 34 | ); 35 | 36 | my $cmdline = $WgetTest::WGETPATH . " --spider http://localhost:{{port}}/index.html"; 37 | 38 | my $expected_error_code = 0; 39 | 40 | my %expected_downloaded_files = ( 41 | ); 42 | 43 | ############################################################################### 44 | 45 | my $the_test = HTTPTest->new (name => "Test--spider", 46 | input => \%urls, 47 | cmdline => $cmdline, 48 | errcode => $expected_error_code, 49 | output => \%expected_downloaded_files); 50 | exit $the_test->run(); 51 | 52 | # vim: et ts=4 sw=4 53 | 54 | -------------------------------------------------------------------------------- /tests/Test-E-k-K.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Main Page Title 15 | 16 | 17 | Secondary Page 18 | 19 | 20 | EOF 21 | 22 | my $mainpagemangled = < 24 | 25 | Main Page Title 26 | 27 | 28 | Secondary Page 29 | 30 | 31 | EOF 32 | 33 | my $subpage = < 35 | 36 | Secondary Page Title 37 | 38 | 39 |

Some text

40 | 41 | 42 | EOF 43 | 44 | # code, msg, headers, content 45 | my %urls = ( 46 | '/index.php' => { 47 | code => "200", 48 | msg => "Dontcare", 49 | headers => { 50 | "Content-type" => "text/html", 51 | }, 52 | content => $mainpage, 53 | }, 54 | '/subpage.php' => { 55 | code => "200", 56 | msg => "Dontcare", 57 | headers => { 58 | "Content-type" => "text/html", 59 | }, 60 | content => $subpage, 61 | }, 62 | ); 63 | 64 | my $cmdline = $WgetTest::WGETPATH . " -r -nd -E -k -K http://localhost:{{port}}/index.php"; 65 | 66 | my $expected_error_code = 0; 67 | 68 | my %expected_downloaded_files = ( 69 | 'index.php.orig' => { 70 | content => $mainpage, 71 | }, 72 | 'index.php.html' => { 73 | content => $mainpagemangled, 74 | }, 75 | 'subpage.php.html' => { 76 | content => $subpage, 77 | }, 78 | ); 79 | 80 | ############################################################################### 81 | 82 | my $the_test = HTTPTest->new (name => "Test-E-k-K", 83 | input => \%urls, 84 | cmdline => $cmdline, 85 | errcode => $expected_error_code, 86 | output => \%expected_downloaded_files); 87 | exit $the_test->run(); 88 | 89 | # vim: et ts=4 sw=4 90 | 91 | -------------------------------------------------------------------------------- /tests/Test-E-k.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Main Page Title 15 | 16 | 17 | Secondary Page 18 | 19 | 20 | EOF 21 | 22 | my $mainpagemangled = < 24 | 25 | Main Page Title 26 | 27 | 28 | Secondary Page 29 | 30 | 31 | EOF 32 | 33 | my $subpage = < 35 | 36 | Secondary Page Title 37 | 38 | 39 |

Some text

40 | 41 | 42 | EOF 43 | 44 | # code, msg, headers, content 45 | my %urls = ( 46 | '/index.php' => { 47 | code => "200", 48 | msg => "Dontcare", 49 | headers => { 50 | "Content-type" => "text/html", 51 | }, 52 | content => $mainpage, 53 | }, 54 | '/subpage.php' => { 55 | code => "200", 56 | msg => "Dontcare", 57 | headers => { 58 | "Content-type" => "text/html", 59 | }, 60 | content => $subpage, 61 | }, 62 | ); 63 | 64 | my $cmdline = $WgetTest::WGETPATH . " -r -nd -E -k http://localhost:{{port}}/index.php"; 65 | 66 | my $expected_error_code = 0; 67 | 68 | my %expected_downloaded_files = ( 69 | 'index.php.html' => { 70 | content => $mainpagemangled, 71 | }, 72 | 'subpage.php.html' => { 73 | content => $subpage, 74 | }, 75 | ); 76 | 77 | ############################################################################### 78 | 79 | my $the_test = HTTPTest->new (name => "Test-E-k", 80 | input => \%urls, 81 | cmdline => $cmdline, 82 | errcode => $expected_error_code, 83 | output => \%expected_downloaded_files); 84 | exit $the_test->run(); 85 | 86 | # vim: et ts=4 sw=4 87 | 88 | -------------------------------------------------------------------------------- /tests/Test-HTTP-Content-Disposition-1.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dontcare = < 17 | 18 | Page Title 19 | 20 | 21 |

22 | Some text. 23 |

24 | 25 | 26 | EOF 27 | 28 | # code, msg, headers, content 29 | my %urls = ( 30 | '/dummy.html' => { 31 | code => "200", 32 | msg => "Dontcare", 33 | headers => { 34 | "Content-type" => "text/html", 35 | "Content-Disposition" => "attachment; filename=\"filename.html\"", 36 | }, 37 | content => $dummyfile, 38 | }, 39 | ); 40 | 41 | my $cmdline = $WgetTest::WGETPATH . " -e contentdisposition=on http://localhost:{{port}}/dummy.html"; 42 | 43 | my $expected_error_code = 0; 44 | 45 | my %existing_files = ( 46 | 'filename.html' => { 47 | content => $dontcare, 48 | }, 49 | 'filename.html.1' => { 50 | content => $dontcare, 51 | }, 52 | ); 53 | 54 | my %expected_downloaded_files = ( 55 | 'filename.html' => { 56 | content => $dontcare, 57 | }, 58 | 'filename.html.1' => { 59 | content => $dontcare, 60 | }, 61 | 'filename.html.2' => { 62 | content => $dummyfile, 63 | }, 64 | ); 65 | 66 | ############################################################################### 67 | 68 | my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-1", 69 | input => \%urls, 70 | cmdline => $cmdline, 71 | errcode => $expected_error_code, 72 | existing => \%existing_files, 73 | output => \%expected_downloaded_files); 74 | exit $the_test->run(); 75 | 76 | # vim: et ts=4 sw=4 77 | 78 | -------------------------------------------------------------------------------- /tests/Test-HTTP-Content-Disposition-2.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dontcare = < 17 | 18 | Page Title 19 | 20 | 21 |

22 | Some text. 23 |

24 | 25 | 26 | EOF 27 | 28 | # code, msg, headers, content 29 | my %urls = ( 30 | '/dummy.html' => { 31 | code => "200", 32 | msg => "Dontcare", 33 | headers => { 34 | "Content-type" => "text/html", 35 | "Content-Disposition" => "attachment; filename=\"filename.html\"", 36 | }, 37 | content => $dummyfile, 38 | }, 39 | ); 40 | 41 | my $cmdline = $WgetTest::WGETPATH . " --no-content-disposition http://localhost:{{port}}/dummy.html"; 42 | 43 | my $expected_error_code = 0; 44 | 45 | my %existing_files = ( 46 | 'filename.html' => { 47 | content => $dontcare, 48 | }, 49 | 'filename.html.1' => { 50 | content => $dontcare, 51 | }, 52 | ); 53 | 54 | my %expected_downloaded_files = ( 55 | 'filename.html' => { 56 | content => $dontcare, 57 | }, 58 | 'filename.html.1' => { 59 | content => $dontcare, 60 | }, 61 | 'dummy.html' => { 62 | content => $dummyfile, 63 | }, 64 | ); 65 | 66 | ############################################################################### 67 | 68 | my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition-2", 69 | input => \%urls, 70 | cmdline => $cmdline, 71 | errcode => $expected_error_code, 72 | existing => \%existing_files, 73 | output => \%expected_downloaded_files); 74 | exit $the_test->run(); 75 | 76 | # vim: et ts=4 sw=4 77 | 78 | -------------------------------------------------------------------------------- /tests/Test-HTTP-Content-Disposition.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < 13 | 14 | Page Title 15 | 16 | 17 |

18 | Some text. 19 |

20 | 21 | 22 | EOF 23 | 24 | # code, msg, headers, content 25 | my %urls = ( 26 | '/dummy.html' => { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/html", 31 | "Content-Disposition" => "attachment; filename=\"filename.html\"", 32 | }, 33 | content => $dummyfile, 34 | }, 35 | ); 36 | 37 | my $cmdline = $WgetTest::WGETPATH . " -e contentdisposition=on http://localhost:{{port}}/dummy.html"; 38 | 39 | my $expected_error_code = 0; 40 | 41 | my %expected_downloaded_files = ( 42 | 'filename.html' => { 43 | content => $dummyfile, 44 | } 45 | ); 46 | 47 | ############################################################################### 48 | 49 | my $the_test = HTTPTest->new (name => "Test-HTTP-Content-Disposition", 50 | input => \%urls, 51 | cmdline => $cmdline, 52 | errcode => $expected_error_code, 53 | output => \%expected_downloaded_files); 54 | exit $the_test->run(); 55 | 56 | # vim: et ts=4 sw=4 57 | 58 | -------------------------------------------------------------------------------- /tests/Test-N--no-content-disposition-trivial.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 23 | }, 24 | content => $dummyfile 25 | }, 26 | ); 27 | 28 | my $cmdline = $WgetTest::WGETPATH . " -N --no-content-disposition http://localhost:{{port}}/dummy.txt"; 29 | 30 | my $expected_error_code = 0; 31 | 32 | my %expected_downloaded_files = ( 33 | 'dummy.txt' => { 34 | content => $dummyfile, 35 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 36 | } 37 | ); 38 | 39 | ############################################################################### 40 | 41 | my $the_test = HTTPTest->new (name => "Test-N--no-content-disposition-trivial", 42 | input => \%urls, 43 | cmdline => $cmdline, 44 | errcode => $expected_error_code, 45 | output => \%expected_downloaded_files); 46 | exit $the_test->run(); 47 | 48 | # vim: et ts=4 sw=4 49 | 50 | -------------------------------------------------------------------------------- /tests/Test-N--no-content-disposition.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 23 | "Content-Disposition" => "attachment; filename=\"filename.txt\"", 24 | }, 25 | content => $dummyfile 26 | }, 27 | ); 28 | 29 | my $cmdline = $WgetTest::WGETPATH . " -N --no-content-disposition http://localhost:{{port}}/dummy.txt"; 30 | 31 | my $expected_error_code = 0; 32 | 33 | my %expected_downloaded_files = ( 34 | 'dummy.txt' => { 35 | content => $dummyfile, 36 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 37 | } 38 | ); 39 | 40 | ############################################################################### 41 | 42 | my $the_test = HTTPTest->new (name => "Test-N--no-content-disposition", 43 | input => \%urls, 44 | cmdline => $cmdline, 45 | errcode => $expected_error_code, 46 | output => \%expected_downloaded_files); 47 | exit $the_test->run(); 48 | 49 | # vim: et ts=4 sw=4 50 | 51 | -------------------------------------------------------------------------------- /tests/Test-N-HTTP-Content-Disposition.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 23 | "Content-Disposition" => "attachment; filename=\"filename.txt\"", 24 | }, 25 | content => $dummyfile 26 | }, 27 | ); 28 | 29 | my $cmdline = $WgetTest::WGETPATH . " -N --content-disposition " 30 | . "http://localhost:{{port}}/dummy.txt"; 31 | 32 | my $expected_error_code = 0; 33 | 34 | my %expected_downloaded_files = ( 35 | 'filename.txt' => { 36 | content => $dummyfile, 37 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 38 | } 39 | ); 40 | 41 | ############################################################################### 42 | 43 | my $the_test = HTTPTest->new (name => "Test-N-HTTP-Content-Disposition", 44 | input => \%urls, 45 | cmdline => $cmdline, 46 | errcode => $expected_error_code, 47 | output => \%expected_downloaded_files); 48 | exit $the_test->run(); 49 | 50 | # vim: et ts=4 sw=4 51 | 52 | -------------------------------------------------------------------------------- /tests/Test-N-current.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $currentversion = < { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/plain", 31 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 32 | }, 33 | content => $modifiedversion, 34 | }, 35 | ); 36 | 37 | my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/somefile.txt"; 38 | 39 | my $expected_error_code = 0; 40 | 41 | my %existing_files = ( 42 | 'somefile.txt' => { 43 | content => $currentversion, 44 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 45 | }, 46 | ); 47 | 48 | my %expected_downloaded_files = ( 49 | 'somefile.txt' => { 50 | content => $currentversion, 51 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 52 | }, 53 | ); 54 | 55 | ############################################################################### 56 | 57 | my $the_test = HTTPTest->new (name => "Test-N-current", 58 | input => \%urls, 59 | cmdline => $cmdline, 60 | errcode => $expected_error_code, 61 | existing => \%existing_files, 62 | output => \%expected_downloaded_files); 63 | exit $the_test->run(); 64 | 65 | # vim: et ts=4 sw=4 66 | 67 | -------------------------------------------------------------------------------- /tests/Test-N-no-info.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $currentversion = < { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/plain", 31 | }, 32 | content => $newversion, 33 | }, 34 | ); 35 | 36 | my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/somefile.txt"; 37 | 38 | my $expected_error_code = 0; 39 | 40 | my %existing_files = ( 41 | 'somefile.txt' => { 42 | content => $currentversion, 43 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 44 | }, 45 | ); 46 | 47 | my %expected_downloaded_files = ( 48 | 'somefile.txt' => { 49 | content => $newversion, 50 | }, 51 | ); 52 | 53 | ############################################################################### 54 | 55 | my $the_test = HTTPTest->new (name => "Test-N-current", 56 | input => \%urls, 57 | cmdline => $cmdline, 58 | errcode => $expected_error_code, 59 | existing => \%existing_files, 60 | output => \%expected_downloaded_files); 61 | exit $the_test->run(); 62 | 63 | # vim: et ts=4 sw=4 64 | 65 | -------------------------------------------------------------------------------- /tests/Test-N-old.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $oldversion = < { 25 | code => "200", 26 | msg => "Dontcare", 27 | headers => { 28 | "Content-type" => "text/plain", 29 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 30 | }, 31 | content => $newversion, 32 | }, 33 | ); 34 | 35 | my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/somefile.txt"; 36 | 37 | my $expected_error_code = 0; 38 | 39 | my %existing_files = ( 40 | 'somefile.txt' => { 41 | content => $oldversion, 42 | timestamp => 1097310000, # Earlier timestamp 43 | }, 44 | ); 45 | 46 | my %expected_downloaded_files = ( 47 | 'somefile.txt' => { 48 | content => $newversion, 49 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 50 | }, 51 | ); 52 | 53 | ############################################################################### 54 | 55 | my $the_test = HTTPTest->new (name => "Test-N-old", 56 | input => \%urls, 57 | cmdline => $cmdline, 58 | errcode => $expected_error_code, 59 | existing => \%existing_files, 60 | output => \%expected_downloaded_files); 61 | exit $the_test->run(); 62 | 63 | # vim: et ts=4 sw=4 64 | 65 | -------------------------------------------------------------------------------- /tests/Test-N-smaller.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $currentversion = < { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/plain", 31 | "Content-Length" => length $newversion, 32 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 33 | }, 34 | content => $newversion, 35 | }, 36 | ); 37 | 38 | my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/somefile.txt"; 39 | 40 | my $expected_error_code = 0; 41 | 42 | my %existing_files = ( 43 | 'somefile.txt' => { 44 | content => $currentversion, 45 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 46 | }, 47 | ); 48 | 49 | my %expected_downloaded_files = ( 50 | 'somefile.txt' => { 51 | content => $newversion, 52 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 53 | }, 54 | ); 55 | 56 | ############################################################################### 57 | 58 | my $the_test = HTTPTest->new (name => "Test-N-current", 59 | input => \%urls, 60 | cmdline => $cmdline, 61 | errcode => $expected_error_code, 62 | existing => \%existing_files, 63 | output => \%expected_downloaded_files); 64 | exit $the_test->run(); 65 | 66 | # vim: et ts=4 sw=4 67 | 68 | -------------------------------------------------------------------------------- /tests/Test-N.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 23 | }, 24 | content => $dummyfile 25 | }, 26 | ); 27 | 28 | my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/dummy.txt"; 29 | 30 | my $expected_error_code = 0; 31 | 32 | my %expected_downloaded_files = ( 33 | 'dummy.txt' => { 34 | content => $dummyfile, 35 | timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT" 36 | } 37 | ); 38 | 39 | ############################################################################### 40 | 41 | my $the_test = HTTPTest->new (name => "Test-N", 42 | input => \%urls, 43 | cmdline => $cmdline, 44 | errcode => $expected_error_code, 45 | output => \%expected_downloaded_files); 46 | exit $the_test->run(); 47 | 48 | # vim: et ts=4 sw=4 49 | 50 | -------------------------------------------------------------------------------- /tests/Test-O--no-content-disposition-trivial.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | }, 23 | content => $dummyfile 24 | }, 25 | ); 26 | 27 | my $cmdline = $WgetTest::WGETPATH . " -O out --no-content-disposition http://localhost:{{port}}/dummy.txt"; 28 | 29 | my $expected_error_code = 0; 30 | 31 | my %expected_downloaded_files = ( 32 | 'out' => { 33 | content => $dummyfile, 34 | } 35 | ); 36 | 37 | ############################################################################### 38 | 39 | my $the_test = HTTPTest->new (name => "Test-O--no-content-disposition-trivial", 40 | input => \%urls, 41 | cmdline => $cmdline, 42 | errcode => $expected_error_code, 43 | output => \%expected_downloaded_files); 44 | exit $the_test->run(); 45 | 46 | # vim: et ts=4 sw=4 47 | 48 | -------------------------------------------------------------------------------- /tests/Test-O--no-content-disposition.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | "Content-Disposition" => "attachment; filename=\"filename.txt\"", 23 | }, 24 | content => $dummyfile 25 | }, 26 | ); 27 | 28 | my $cmdline = $WgetTest::WGETPATH . " -O out --no-content-disposition http://localhost:{{port}}/dummy.txt"; 29 | 30 | my $expected_error_code = 0; 31 | 32 | my %expected_downloaded_files = ( 33 | 'out' => { 34 | content => $dummyfile, 35 | } 36 | ); 37 | 38 | ############################################################################### 39 | 40 | my $the_test = HTTPTest->new (name => "Test-O--no-content-disposition", 41 | input => \%urls, 42 | cmdline => $cmdline, 43 | errcode => $expected_error_code, 44 | output => \%expected_downloaded_files); 45 | exit $the_test->run(); 46 | 47 | # vim: et ts=4 sw=4 48 | 49 | -------------------------------------------------------------------------------- /tests/Test-O-HTTP-Content-Disposition.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | "Content-Disposition" => "attachment; filename=\"filename.txt\"", 23 | }, 24 | content => $dummyfile 25 | }, 26 | ); 27 | 28 | my $cmdline = $WgetTest::WGETPATH . " -O out http://localhost:{{port}}/dummy.txt"; 29 | 30 | my $expected_error_code = 0; 31 | 32 | my %expected_downloaded_files = ( 33 | 'out' => { 34 | content => $dummyfile, 35 | } 36 | ); 37 | 38 | ############################################################################### 39 | 40 | my $the_test = HTTPTest->new (name => "Test-O-HTTP-Content-Disposition", 41 | input => \%urls, 42 | cmdline => $cmdline, 43 | errcode => $expected_error_code, 44 | output => \%expected_downloaded_files); 45 | exit $the_test->run(); 46 | 47 | # vim: et ts=4 sw=4 48 | 49 | -------------------------------------------------------------------------------- /tests/Test-O-nc.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | }, 23 | content => $dummyfile 24 | }, 25 | ); 26 | 27 | my $cmdline = $WgetTest::WGETPATH . " -nc -O out http://localhost:{{port}}/dummy.txt"; 28 | 29 | my $expected_error_code = 0; 30 | 31 | my %expected_downloaded_files = ( 32 | 'out' => { 33 | content => $dummyfile, 34 | } 35 | ); 36 | 37 | ############################################################################### 38 | 39 | my $the_test = HTTPTest->new (name => "Test-O-nc", 40 | input => \%urls, 41 | cmdline => $cmdline, 42 | errcode => $expected_error_code, 43 | output => \%expected_downloaded_files); 44 | exit $the_test->run(); 45 | 46 | # vim: et ts=4 sw=4 47 | 48 | -------------------------------------------------------------------------------- /tests/Test-O-nonexisting.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/html", 22 | }, 23 | content => $dummyfile 24 | }, 25 | ); 26 | 27 | my $cmdline = $WgetTest::WGETPATH . " --quiet -O out http://localhost:{{port}}/nonexistent"; 28 | 29 | my $expected_error_code = 8; 30 | 31 | my %expected_downloaded_files = ( 32 | 'out' => { 33 | content => "", 34 | } 35 | ); 36 | 37 | ############################################################################### 38 | 39 | my $the_test = HTTPTest->new (name => "Test-O-nonexisting", 40 | input => \%urls, 41 | cmdline => $cmdline, 42 | errcode => $expected_error_code, 43 | output => \%expected_downloaded_files); 44 | exit $the_test->run(); 45 | 46 | # vim: et ts=4 sw=4 47 | 48 | -------------------------------------------------------------------------------- /tests/Test-O.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $dummyfile = < { 18 | code => "200", 19 | msg => "Dontcare", 20 | headers => { 21 | "Content-type" => "text/plain", 22 | }, 23 | content => $dummyfile 24 | }, 25 | ); 26 | 27 | my $cmdline = $WgetTest::WGETPATH . " -O out http://localhost:{{port}}/dummy.txt"; 28 | 29 | my $expected_error_code = 0; 30 | 31 | my %expected_downloaded_files = ( 32 | 'out' => { 33 | content => $dummyfile, 34 | } 35 | ); 36 | 37 | ############################################################################### 38 | 39 | my $the_test = HTTPTest->new (name => "Test-O", 40 | input => \%urls, 41 | cmdline => $cmdline, 42 | errcode => $expected_error_code, 43 | output => \%expected_downloaded_files); 44 | exit $the_test->run(); 45 | 46 | # vim: et ts=4 sw=4 47 | 48 | -------------------------------------------------------------------------------- /tests/Test-Restrict-Lowercase.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Some Page Title 15 | 16 | 17 |

18 | Some text... 19 |

20 | 21 | 22 | EOF 23 | 24 | # code, msg, headers, content 25 | my %urls = ( 26 | '/SomePage.html' => { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/html", 31 | }, 32 | content => $mainpage, 33 | }, 34 | ); 35 | 36 | my $cmdline = $WgetTest::WGETPATH . " --restrict-file-names=lowercase http://localhost:{{port}}/SomePage.html"; 37 | 38 | my $expected_error_code = 0; 39 | 40 | my %expected_downloaded_files = ( 41 | 'somepage.html' => { 42 | content => $mainpage, 43 | }, 44 | ); 45 | 46 | ############################################################################### 47 | 48 | my $the_test = HTTPTest->new (name => "Test-Restrict-Lowercase", 49 | input => \%urls, 50 | cmdline => $cmdline, 51 | errcode => $expected_error_code, 52 | output => \%expected_downloaded_files); 53 | exit $the_test->run(); 54 | 55 | # vim: et ts=4 sw=4 56 | 57 | -------------------------------------------------------------------------------- /tests/Test-Restrict-Uppercase.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $mainpage = < 13 | 14 | Some Page Title 15 | 16 | 17 |

18 | Some text... 19 |

20 | 21 | 22 | EOF 23 | 24 | # code, msg, headers, content 25 | my %urls = ( 26 | '/SomePage.html' => { 27 | code => "200", 28 | msg => "Dontcare", 29 | headers => { 30 | "Content-type" => "text/html", 31 | }, 32 | content => $mainpage, 33 | }, 34 | ); 35 | 36 | my $cmdline = $WgetTest::WGETPATH . " --restrict-file-names=uppercase http://localhost:{{port}}/SomePage.html"; 37 | 38 | my $expected_error_code = 0; 39 | 40 | my %expected_downloaded_files = ( 41 | 'SOMEPAGE.HTML' => { 42 | content => $mainpage, 43 | }, 44 | ); 45 | 46 | ############################################################################### 47 | 48 | my $the_test = HTTPTest->new (name => "Test-Restrict-Uppercase", 49 | input => \%urls, 50 | cmdline => $cmdline, 51 | errcode => $expected_error_code, 52 | output => \%expected_downloaded_files); 53 | exit $the_test->run(); 54 | 55 | # vim: et ts=4 sw=4 56 | 57 | -------------------------------------------------------------------------------- /tests/Test-auth-basic.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $wholefile = "You're all authenticated.\n"; 12 | 13 | # code, msg, headers, content 14 | my %urls = ( 15 | '/needs-auth.txt' => { 16 | auth_method => 'Basic', 17 | user => 'fiddle-dee-dee', 18 | passwd => 'Dodgson', 19 | code => "200", 20 | msg => "You want fries with that?", 21 | headers => { 22 | "Content-type" => "text/plain", 23 | }, 24 | content => $wholefile, 25 | }, 26 | ); 27 | 28 | my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee --password=Dodgson" 29 | . " http://localhost:{{port}}/needs-auth.txt"; 30 | 31 | my $expected_error_code = 0; 32 | 33 | my %expected_downloaded_files = ( 34 | 'needs-auth.txt' => { 35 | content => $wholefile, 36 | }, 37 | ); 38 | 39 | ############################################################################### 40 | 41 | my $the_test = HTTPTest->new (name => "Test-auth-basic", 42 | input => \%urls, 43 | cmdline => $cmdline, 44 | errcode => $expected_error_code, 45 | output => \%expected_downloaded_files); 46 | exit $the_test->run(); 47 | 48 | # vim: et ts=4 sw=4 49 | 50 | -------------------------------------------------------------------------------- /tests/Test-auth-no-challenge-url.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $wholefile = "You're all authenticated.\n"; 12 | 13 | # code, msg, headers, content 14 | my %urls = ( 15 | '/needs-auth.txt' => { 16 | auth_no_challenge => 1, 17 | auth_method => 'Basic', 18 | user => 'fiddle-dee-dee', 19 | passwd => 'Dodgson', 20 | code => "200", 21 | msg => "You want fries with that?", 22 | headers => { 23 | "Content-type" => "text/plain", 24 | }, 25 | content => $wholefile, 26 | }, 27 | ); 28 | 29 | my $cmdline = $WgetTest::WGETPATH . " --auth-no-challenge " 30 | . "http://fiddle-dee-dee:Dodgson\@localhost:{{port}}/needs-auth.txt"; 31 | 32 | my $expected_error_code = 0; 33 | 34 | my %expected_downloaded_files = ( 35 | 'needs-auth.txt' => { 36 | content => $wholefile, 37 | }, 38 | ); 39 | 40 | ############################################################################### 41 | 42 | my $the_test = HTTPTest->new (name => "Test-auth-no-challenge-url", 43 | input => \%urls, 44 | cmdline => $cmdline, 45 | errcode => $expected_error_code, 46 | output => \%expected_downloaded_files); 47 | exit $the_test->run(); 48 | 49 | # vim: et ts=4 sw=4 50 | 51 | -------------------------------------------------------------------------------- /tests/Test-auth-no-challenge.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $wholefile = "You're all authenticated.\n"; 12 | 13 | # code, msg, headers, content 14 | my %urls = ( 15 | '/needs-auth.txt' => { 16 | auth_no_challenge => 1, 17 | auth_method => 'Basic', 18 | user => 'fiddle-dee-dee', 19 | passwd => 'Dodgson', 20 | code => "200", 21 | msg => "You want fries with that?", 22 | headers => { 23 | "Content-type" => "text/plain", 24 | }, 25 | content => $wholefile, 26 | }, 27 | ); 28 | 29 | my $cmdline = $WgetTest::WGETPATH . " --auth-no-challenge" 30 | . " --user=fiddle-dee-dee --password=Dodgson" 31 | . " http://localhost:{{port}}/needs-auth.txt"; 32 | 33 | my $expected_error_code = 0; 34 | 35 | my %expected_downloaded_files = ( 36 | 'needs-auth.txt' => { 37 | content => $wholefile, 38 | }, 39 | ); 40 | 41 | ############################################################################### 42 | 43 | my $the_test = HTTPTest->new (name => "Test-auth-no-challenge", 44 | input => \%urls, 45 | cmdline => $cmdline, 46 | errcode => $expected_error_code, 47 | output => \%expected_downloaded_files); 48 | exit $the_test->run(); 49 | 50 | # vim: et ts=4 sw=4 51 | 52 | -------------------------------------------------------------------------------- /tests/Test-auth-retcode.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | # code, msg, headers, content 12 | my %urls = ( 13 | '/dummy.txt' => { 14 | code => "403", 15 | msg => "Dontcare", 16 | headers => { 17 | "Content-type" => "text/plain", 18 | "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT", 19 | }, 20 | }, 21 | ); 22 | 23 | my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/dummy.txt"; 24 | 25 | my $expected_error_code = 8; 26 | 27 | my %expected_downloaded_files = (); 28 | 29 | ############################################################################### 30 | 31 | my $the_test = HTTPTest->new (name => "Test-auth-retcode", 32 | input => \%urls, 33 | cmdline => $cmdline, 34 | errcode => $expected_error_code, 35 | output => \%expected_downloaded_files); 36 | exit $the_test->run(); 37 | 38 | # vim: et ts=4 sw=4 39 | -------------------------------------------------------------------------------- /tests/Test-auth-with-content-disposition.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $wholefile = "You're all authenticated.\n"; 12 | 13 | # code, msg, headers, content 14 | my %urls = ( 15 | '/needs-auth.txt' => { 16 | auth_method => 'Basic', 17 | user => 'fiddle-dee-dee', 18 | passwd => 'Dodgson', 19 | code => "200", 20 | msg => "You want fries with that?", 21 | headers => { 22 | "Content-type" => "text/plain", 23 | "Content-Disposition" => "attachment; filename=\"Flubber\"", 24 | }, 25 | content => $wholefile, 26 | }, 27 | ); 28 | 29 | my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee --password=Dodgson" 30 | . " --content-disposition http://localhost:{{port}}/needs-auth.txt"; 31 | 32 | my $expected_error_code = 0; 33 | 34 | my %expected_downloaded_files = ( 35 | 'Flubber' => { 36 | content => $wholefile, 37 | }, 38 | ); 39 | 40 | ############################################################################### 41 | 42 | my $the_test = HTTPTest->new (name => "Test-auth-with-content-disposition", 43 | input => \%urls, 44 | cmdline => $cmdline, 45 | errcode => $expected_error_code, 46 | output => \%expected_downloaded_files); 47 | exit $the_test->run(); 48 | 49 | # vim: et ts=4 sw=4 50 | 51 | -------------------------------------------------------------------------------- /tests/Test-c-full.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $wholefile = < { 22 | code => "200", 23 | msg => "Dontcare", 24 | headers => { 25 | "Content-type" => "text/plain", 26 | }, 27 | content => $wholefile, 28 | }, 29 | ); 30 | 31 | my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:{{port}}/somefile.txt"; 32 | 33 | my $expected_error_code = 0; 34 | 35 | my %existing_files = ( 36 | 'somefile.txt' => { 37 | content => $wholefile, 38 | }, 39 | ); 40 | 41 | my %expected_downloaded_files = ( 42 | 'somefile.txt' => { 43 | content => $wholefile, 44 | }, 45 | ); 46 | 47 | ############################################################################### 48 | 49 | my $the_test = HTTPTest->new (name => "Test-c-full", 50 | input => \%urls, 51 | cmdline => $cmdline, 52 | errcode => $expected_error_code, 53 | existing => \%existing_files, 54 | output => \%expected_downloaded_files); 55 | exit $the_test->run(); 56 | 57 | # vim: et ts=4 sw=4 58 | 59 | -------------------------------------------------------------------------------- /tests/Test-c-partial.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $partiallydownloaded = < { 32 | code => "200", 33 | msg => "Dontcare", 34 | headers => { 35 | "Content-type" => "text/plain", 36 | }, 37 | content => $wholefile, 38 | }, 39 | ); 40 | 41 | my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:{{port}}/somefile.txt"; 42 | 43 | my $expected_error_code = 0; 44 | 45 | my %existing_files = ( 46 | 'somefile.txt' => { 47 | content => $partiallydownloaded, 48 | }, 49 | ); 50 | 51 | my %expected_downloaded_files = ( 52 | 'somefile.txt' => { 53 | content => $downloadedfile, 54 | }, 55 | ); 56 | 57 | ############################################################################### 58 | 59 | my $the_test = HTTPTest->new (name => "Test-c-partial", 60 | input => \%urls, 61 | cmdline => $cmdline, 62 | errcode => $expected_error_code, 63 | existing => \%existing_files, 64 | output => \%expected_downloaded_files); 65 | exit $the_test->run(); 66 | 67 | # vim: et ts=4 sw=4 68 | 69 | -------------------------------------------------------------------------------- /tests/Test-c-shorter.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $partiallydownloaded = < { 27 | code => "200", 28 | force_code => 1, 29 | msg => "Dontcare", 30 | headers => { 31 | "Content-type" => "text/plain", 32 | "Content-Length" => 0, 33 | }, 34 | content => '', 35 | }, 36 | ); 37 | 38 | my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:{{port}}/somefile.txt"; 39 | 40 | my $expected_error_code = 0; 41 | 42 | my %existing_files = ( 43 | 'somefile.txt' => { 44 | content => $downloadedfile, 45 | }, 46 | ); 47 | 48 | my %expected_downloaded_files = ( 49 | 'somefile.txt' => { 50 | content => $downloadedfile, 51 | }, 52 | ); 53 | 54 | ############################################################################### 55 | 56 | my $the_test = HTTPTest->new (name => "Test-c-partial", 57 | input => \%urls, 58 | cmdline => $cmdline, 59 | errcode => $expected_error_code, 60 | existing => \%existing_files, 61 | output => \%expected_downloaded_files); 62 | exit $the_test->run(); 63 | 64 | # vim: et ts=4 sw=4 65 | 66 | -------------------------------------------------------------------------------- /tests/Test-c.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $wholefile = < { 22 | code => "200", 23 | msg => "Dontcare", 24 | headers => { 25 | "Content-type" => "text/plain", 26 | }, 27 | content => $wholefile, 28 | }, 29 | ); 30 | 31 | my $cmdline = $WgetTest::WGETPATH . " -c http://localhost:{{port}}/somefile.txt"; 32 | 33 | my $expected_error_code = 0; 34 | 35 | my %existing_files = ( 36 | ); 37 | 38 | my %expected_downloaded_files = ( 39 | 'somefile.txt' => { 40 | content => $wholefile, 41 | }, 42 | ); 43 | 44 | ############################################################################### 45 | 46 | my $the_test = HTTPTest->new (name => "Test-c", 47 | input => \%urls, 48 | cmdline => $cmdline, 49 | errcode => $expected_error_code, 50 | existing => \%existing_files, 51 | output => \%expected_downloaded_files); 52 | exit $the_test->run(); 53 | 54 | # vim: et ts=4 sw=4 55 | 56 | -------------------------------------------------------------------------------- /tests/Test-cookies-401.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use HTTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $content = "You got it.\n"; 12 | 13 | # code, msg, headers, content 14 | my %urls = ( 15 | '/one.txt' => { 16 | code => "401", 17 | msg => "Forbidden", 18 | headers => { 19 | "Set-Cookie" => "foo=bar", 20 | }, 21 | }, 22 | '/two.txt' => { 23 | code => "200", 24 | msg => "Ok", 25 | content => $content, 26 | request_headers => { 27 | "Cookie" => qr|foo=bar|, 28 | }, 29 | }, 30 | ); 31 | 32 | my $cmdline = $WgetTest::WGETPATH . " http://localhost:{{port}}/one.txt" 33 | . " http://localhost:{{port}}/two.txt"; 34 | 35 | my $expected_error_code = 6; 36 | 37 | my %expected_downloaded_files = ( 38 | 'two.txt' => { 39 | content => $content, 40 | }, 41 | ); 42 | 43 | ############################################################################### 44 | 45 | my $the_test = HTTPTest->new (name => "Test-cookies-401", 46 | input => \%urls, 47 | cmdline => $cmdline, 48 | errcode => $expected_error_code, 49 | output => \%expected_downloaded_files); 50 | exit $the_test->run(); 51 | 52 | # vim: et ts=4 sw=4 53 | 54 | -------------------------------------------------------------------------------- /tests/Test-ftp-bad-list.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use FTPTest; 7 | 8 | 9 | ############################################################################### 10 | 11 | my $afile = < { 25 | content => $afile, 26 | }, 27 | '/bfile.txt' => { 28 | content => $bfile, 29 | }, 30 | ); 31 | 32 | my $cmdline = $WgetTest::WGETPATH . " -nH -Nc -r ftp://localhost:{{port}}/"; 33 | 34 | my $expected_error_code = 0; 35 | 36 | # Don't need to worry about timestamps, the "bad_list" setting will 37 | # ensure the sizes don't match expectations, and so they'll always be 38 | # re-downloaded. 39 | my %expected_downloaded_files = ( 40 | 'afile.txt' => { 41 | content => $afile, 42 | }, 43 | 'bfile.txt' => { 44 | content => $bfile, 45 | }, 46 | ); 47 | 48 | my %preexisting_files = ( 49 | 'afile.txt' => { 50 | content => $afile, 51 | }, 52 | 'bfile.txt' => { 53 | content => $bfile, 54 | }, 55 | ); 56 | 57 | ############################################################################### 58 | 59 | my $the_test = FTPTest->new (name => "Test-ftp-bad-list", 60 | input => \%urls, 61 | cmdline => $cmdline, 62 | errcode => $expected_error_code, 63 | output => \%expected_downloaded_files, 64 | existing => \%preexisting_files, 65 | server_behavior => {bad_list => 1}); 66 | exit $the_test->run(); 67 | 68 | # vim: et ts=4 sw=4 69 | 70 | -------------------------------------------------------------------------------- /tests/Test-ftp-iri-disabled.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use WgetFeature qw(iri); 7 | use FTPTest; 8 | 9 | 10 | ############################################################################### 11 | 12 | my $ccedilla_l1 = "\xE7"; 13 | my $ccedilla_u8 = "\xC3\xA7"; 14 | 15 | my $francais = < { 25 | content => $francais, 26 | }, 27 | "/fran${ccedilla_l1}ais.txt" => { 28 | content => $francais, 29 | }, 30 | ); 31 | 32 | my $cmdline = $WgetTest::WGETPATH . " --no-iri --local-encoding=iso-8859-1 -S ftp://localhost:{{port}}/fran${ccedilla_l1}ais.txt"; 33 | 34 | my $expected_error_code = 0; 35 | 36 | my %expected_downloaded_files = ( 37 | "fran${ccedilla_l1}ais.txt" => { 38 | content => $francais, 39 | }, 40 | ); 41 | 42 | ############################################################################### 43 | 44 | my $the_test = FTPTest->new (name => "Test-ftp-iri-disabled", 45 | input => \%urls, 46 | cmdline => $cmdline, 47 | errcode => $expected_error_code, 48 | output => \%expected_downloaded_files); 49 | exit $the_test->run(); 50 | 51 | # vim: et ts=4 sw=4 52 | 53 | -------------------------------------------------------------------------------- /tests/Test-ftp-iri-fallback.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use WgetFeature qw(iri); 7 | use FTPTest; 8 | 9 | 10 | ############################################################################### 11 | 12 | my $ccedilla_l1 = "\xE7"; 13 | my $ccedilla_u8 = "\xC3\xA7"; 14 | 15 | my $francais = < { 24 | content => $francais, 25 | }, 26 | ); 27 | 28 | my $cmdline = $WgetTest::WGETPATH . " --local-encoding=iso-8859-1 -S ftp://localhost:{{port}}/fran${ccedilla_l1}ais.txt"; 29 | 30 | my $expected_error_code = 0; 31 | 32 | my %expected_downloaded_files = ( 33 | "fran${ccedilla_l1}ais.txt" => { 34 | content => $francais, 35 | }, 36 | ); 37 | 38 | ############################################################################### 39 | 40 | my $the_test = FTPTest->new (name => "Test-ftp-iri-fallback", 41 | input => \%urls, 42 | cmdline => $cmdline, 43 | errcode => $expected_error_code, 44 | output => \%expected_downloaded_files); 45 | exit $the_test->run(); 46 | 47 | # vim: et ts=4 sw=4 48 | 49 | -------------------------------------------------------------------------------- /tests/Test-ftp-iri-recursive.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use WgetFeature qw(iri); 7 | use FTPTest; 8 | 9 | 10 | ############################################################################### 11 | 12 | my $ccedilla_l1 = "\xE7"; 13 | my $ccedilla_u8 = "\xC3\xA7"; 14 | 15 | my $francais = < { 24 | content => $francais, 25 | }, 26 | ); 27 | 28 | my $cmdline = $WgetTest::WGETPATH . " --local-encoding=iso-8859-1 -r -nH -S ftp://localhost:{{port}}/"; 29 | 30 | my $expected_error_code = 0; 31 | 32 | my %expected_downloaded_files = ( 33 | "fran${ccedilla_l1}ais.txt" => { 34 | content => $francais, 35 | }, 36 | ); 37 | 38 | ############################################################################### 39 | 40 | my $the_test = FTPTest->new (name => "Test-ftp-iri-recursive", 41 | input => \%urls, 42 | cmdline => $cmdline, 43 | errcode => $expected_error_code, 44 | output => \%expected_downloaded_files); 45 | exit $the_test->run(); 46 | 47 | # vim: et ts=4 sw=4 48 | 49 | -------------------------------------------------------------------------------- /tests/Test-ftp-iri.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | use WgetFeature qw(iri); 7 | use FTPTest; 8 | 9 | 10 | ############################################################################### 11 | 12 | my $ccedilla_l1 = "\xE7"; 13 | my $ccedilla_u8 = "\xC3\xA7"; 14 | 15 | my $francais = < { 25 | content => $francais, 26 | }, 27 | ); 28 | 29 | my $cmdline = $WgetTest::WGETPATH . " --local-encoding=iso-8859-1 -S ftp://localhost:{{port}}/fran${ccedilla_l1}ais.txt"; 30 | 31 | my $expected_error_code = 0; 32 | 33 | my %expected_downloaded_files = ( 34 | "fran${ccedilla_u8}ais.txt" => { 35 | content => $francais, 36 | }, 37 | ); 38 | 39 | ############################################################################### 40 | 41 | my $the_test = FTPTest->new (name => "Test-ftp-iri", 42 | input => \%urls, 43 | cmdline => $cmdline, 44 | errcode => $expected_error_code, 45 | output => \%expected_downloaded_files); 46 | exit $the_test->run(); 47 | 48 | # vim: et ts=4 sw=4 49 | 50 | -------------------------------------------------------------------------------- /tests/Test-ftp-list-Multinet.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | 4 | # 2013-10-17 Andrea Urbani (matfanjol) 5 | # In this ftp test: 6 | # - the response of SYST command is 7 | # 215 UNIX MultiNet Unix Emulation V5.3(93) 8 | # - the response of "LIST -a" command is an empty 9 | # directory. 10 | # wget should use directly the "LIST" command to get 11 | # the right content, but it will be ok also "LIST -a" 12 | # if followed by "LIST" (in the case of future changes). 13 | 14 | 15 | use strict; 16 | use warnings; 17 | 18 | use FTPTest; 19 | 20 | 21 | ############################################################################### 22 | 23 | my $afile = < { 37 | content => $afile, 38 | }, 39 | '/bfile.txt' => { 40 | content => $bfile, 41 | }, 42 | ); 43 | 44 | my $cmdline = $WgetTest::WGETPATH . " --no-directories --recursive --level=1 --accept \"?file.txt\" ftp://localhost:{{port}}/"; 45 | 46 | my $expected_error_code = 0; 47 | 48 | my %expected_downloaded_files = ( 49 | 'afile.txt' => { 50 | content => $afile, 51 | }, 52 | 'bfile.txt' => { 53 | content => $bfile, 54 | }, 55 | ); 56 | 57 | ############################################################################### 58 | 59 | my $the_test = FTPTest->new (name => "Test-ftp-list-Multinet", 60 | input => \%urls, 61 | cmdline => $cmdline, 62 | errcode => $expected_error_code, 63 | output => \%expected_downloaded_files, 64 | server_behavior => {list_empty_if_list_a => 1, 65 | syst_response => "215 UNIX MultiNet Unix Emulation V5.3(93)"}); 66 | exit $the_test->run(); 67 | 68 | -------------------------------------------------------------------------------- /tests/Test-ftp-list-UNIX-hidden.px: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # 2013-10-17 Andrea Urbani (matfanjol) 4 | # In this ftp test: 5 | # - the response of "LIST -a" command contains 6 | # all the files 7 | # - the response of "LIST" command contains 8 | # the normal files (hidden files are not present) 9 | # wget should use only "LIST -a" because it recognise 10 | # the system as "UNIX Type: L8" and so it should see 11 | # and download the hidden file too. 12 | 13 | use strict; 14 | use warnings; 15 | 16 | use FTPTest; 17 | 18 | 19 | ############################################################################### 20 | 21 | my $normalfile = <