* docs/wget2.md: Document --ocsp default value as 'off'.
* src/options.c (struct config): Disable .ocsp by default.
OCSP validation of the server certificate implies privacy issues:
- The OCSP request tells the CA which web service the client tries to reach.
- The OCSP requests are sent via unencrypted HTTP, so every "listener in the
middle" can see which web service the client tries to connect.
Additionally, the OCSP requests slow down operation and may cause unexpected
network traffic, which may trigger security alarms unnecessarily.
Due to these issues we explicitly disable OCSP by default.
* configure.ac: Enable DANE if libgnutls-dane is installed,
add option --without-libdane.
* docs/wget2.md: Add docs for option --dane.
* include/wget/wget.h: Add WGET_SSL_DANE.
* libwget/ssl_gnutls.c: Include include <gnutls/dane.h> if requested,
(struct config): New member 'dane',
(wget_ssl_set_config_int): Set value for dane via WGET_SSL_DANE,
(wget_ssl_open): Call dane_verify_session_crt().
* src/options.c (options): Add entry for --dane,
(init): Set config.dane via wget_ssl_set_config_int().
* src/wget_options.h (struct config): Add member 'dane'.
This is Wget1.x compatible.
* docs/wget2.md: Document the new behavior.
* libwget/netrc.c (wget_netrc_db_load): Amended the code to allow \ and "".
* unit-tests/test.c (test_netrc): Add tests.
Some terminal emulators now allow printing hyperlinks through escape
sequences. See
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda for
more information.
Hyperlink support cannot be gauged accurately. And while most terminals
just ignore the extra escape sequences, older versions of vte actually
print the URI along with some garbage. So, in this patch, the hyperlink
support is disabled by default and used only if the user explicitly
requests it. Once there is a way to query for feature support in
terminals, this can be intelligently enabled automatically.
* bootstrap.conf: Add new module xgethostname
* src/wget_options.h: Add a new option hyperlink and a global variable
hostname
* src/options.c: Add a new command line option --hyperlink. This is the
same option name as `ls` from coreutils for consistency across
programs
(init): If the user requests hyperlink support, get the hostname and
store it. This is to prevent having to get the hostname for each
downloaded file
* src/wget.c (prepare_file): Print the filename with a hyperlink if the
user requests it.
* docs/wget2.md: Add documentation entry for hyperlinks
* src/options.c: Add --convert-file-only handling
* src/wget_options.h (config): Add bool convert_file_only
* src/wget.c (html_parse): conversions initialized when
convert_file_only is set
(main): Call convert_links when config.convert_file_only
(convert_links): move conversion logic to convert_link_whole and
convert_link_file_only
New function convert_link_whole: convert whole URL
New function convert_link_file_only: convert filename part of URLs
* tests/test-convert-file-only.c: testcase for --convert-file-only
with -E
* tests/Makefile.am: add test-convert-file-only object
* docs/wget2.md: Removed [unimplemented-option] from
--convert-file-only
* src/wget_options.h (config): Added method, body_data, body_file
* src/options.c (options): Added --method, --body-data, --body-file
handling
* src/wget_job.h (JOB): New variable bool redirect_get
* src/wget.c (http_create_request): Added support for user
provided HTTP method and request body
(process_response_header): Set redirect_get to TRUE for 30x
response codes
* tests/test-redirection.c: Added test for redirection with
--method=POST
* docs/wget2.md: Removed [unimplemented-option] for --method,
--body-data, --body-file
* src/wget.c: Likewise, following RFC 7231
* tests/test--filter-mime-type.c: Added tests to ensure this behavior is present
* docs/wget2.md: Added this new behavior to the docs
* src/options.c: Added new option --if-modified-since, and prevented certain combination of flags
* src/wget.c: Added -N --no-if-modified-since implementation itself
* src/wget_job.h: Added bool 'recursive_send_head' to JOB structure
* src/wget_options.h: Added char 'if_modified_since' to config structure
* tests/test--accept.c: Added tests that make use of -N --no-if-modified-since
* tests/test--filter-mime-type.c: Added tests that make use of -N --no-if-modified-since
* tests/test-include-and-exclude-directories.c: Added tests that make use of -N --no-if-modified-since
* tests/test-timestamping.c: Added tests for -N --no-if-modified-since
* docs/wget2.md: Unmarked --no-if-modified-since as "Not Implemented Yet"
* docs/wget2.md: There is no default progress value
* src/options.c: If no progress type specifier is given return an error
* src/wget.c: Set global file size and already downloaded amount when continuing a download
* src/wget.c: Added fork_to_background(), in order to implement --background
* src/options.c: Added "--background" to the options list
* src/wget_options.h: Added background member to structure config
* docs/wget2.md: Background option marked as "Not supported on Windows"
* docs/wget2.md: Added documentation for --ocsp-server
* libwget/ssl_gnutls.c: Modified to use value from option parameter
* src/options.c: Added option handler
* src/wget_options.h: Declared storage for option parameter
Adds functionality to Wget2 to support the XDG Base Directory
Specification[1]. Also marks as deprecated the old location of the
config file.
* docs/wget2.md: Explicitly mark `$HOME/.wget2rc` as deprecated.
* po/potfiles.in: utils.c now has a translateable stirng
* src/options.c(read_config): Use bool instead of int
(get_config_files): Now takes config_home and user_home as input.
`user_home` is only temporary and will be removed once support for
~/.wget2rc is removed.
(get_xdg_data_home): Derives the location where the data files are to be
stored according to [1].
(get_xdg_config_home): Derives the location where the config files are
to be stored according to [1].
(init): Store all the data files in $XD_DATA_HOME
* src/wget.c(mkdir_path): Move function to utils.c
* src/utils.c(mkdir_path): Move function from wget.c. Can now handle
both file and directory paths.
* src/utils.h: Add declaration for mkdir_path
[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
* docs/wget2.md: Add section on initialization files and the order in
which they are read.
* src/options.c(struct config config): Set system_config to the default
value of "SYSCONFDIR/wget2rc"
(struct optionw): --config now maps to config.user_config and update the
value of the default path
(read_config): Read the configuration for system and user configs, if
they're set
(get_config_files): New function that sets the values for
config.system_config and config.user_config. For the system config it
picks either the file in `$SYSTEM_WGET2RC` or at
`/usr/local/etc/wget2rc`. For the user config, it picks the first file from
`--config`, `$WGET2RC`, `$XDG_CONFIG_HOME/wget/wget2rc`,
`~/.config/wget/wget2rc` or `$HOME/.wget2rc`.
(init): Remove the code for finding all the config files and move it to
`get_config_file`.
(deinit): Free config.user_config and config.system_config. Remove
config.config_files.
* src/wget_options.h(struct config): New char * user_config and
system_config. Remove config.config_files