Commit Graph

1019 Commits

Author SHA1 Message Date
1bab5454f9 Fix IPv6 address representation
* libwget/dns.c (resolve): Fix IPv6 in debug message,
  (wget_dns_cache_ip): Fix IPv6 in error message,
  (wget_dns_resolve): Fix IPv6 in debug message.
* libwget/dns_cache.c (wget_dns_cache_get): Fix IPv6 in debug message.
* libwget/hsts.c (hsts_db_add_entry): Fix IPv6 in debug message.
* libwget/http.c (wget_http_create_request): Fix IPv6 in Host header,
  (establish_proxy_connect): Fix IPv6 in CONNECT and in Host header.
* libwget/ip.c (wget_ip_is_family): Cosmetic change.
* libwget/iri.c (wget_iri_get_connection_part): Fix IPv6 in URL creation.
* libwget/net.c (debug_addr): Fix IPv6 in debug message.
* src/options.c (stats_callback_dns): Fix IPv6 in output.
* src/wget.c (test_modify_hsts): Fix IPv6 in console output,
  (http_create_request): Fix IPv6 in Referer header.
* unit-tests/test.c (test_iri_parse): Add two IPv6 parsing tests.
* libwget/Makefile.am (libwget_dnscache.la): Link with libwget_ip.la,
  (libwget_hsts.la): Link with libwget_ip.la.
2023-12-17 18:52:27 +01:00
1c2e2d69a2 * src/options.c (parse_restrict_names): Avoid false positive for -Wjump-misses-init 2023-12-03 18:54:23 +01:00
fa75072eb4 * src/utils.c (wget_restrict_file_name): Remove forgotten info_printf() 2023-12-03 18:44:00 +01:00
2849545536 Fix --restrict-file-names to be backwards compatible wot wget 1.x
* src/options.c (parse_restrict_names): Allow comma-separated list of arguments.
* src/utils.c (wget_restrict_file_name): Support combinations of modes.
2023-12-03 12:32:10 +01:00
3c61c41645 * src/wget.c: Fix minor typo comment 2023-11-04 17:02:29 +01:00
0415d036b3 Fix minor typos in comments 2023-11-04 14:36:43 +01:00
4eb06ba02d * src/wget.c: Fix typos in comments 2023-10-31 11:03:53 +01:00
089520564f * src/wget.c (http_create_request): Use 'Accept: */*' for single file downloads 2023-10-21 19:32:41 +02:00
15ba1db248 Update copyrights 2023-08-31 12:57:30 +02:00
3595963416 Add better default cert/bundle paths for Windows
* include/wget/wget.h: New function wget_ssl_default_cert_dir,
  new function wget_ssl_default_ca_bundle_path.
* libwget/Makefile.am: Add ssl.c.
* libwget/ssl.c: New file for common ssl/tls code.
* libwget/ssl_gnutls.c (tls_init): Initialize cert paths.
* libwget/ssl_openssl.c (tls_init): Likewise.
* libwget/ssl_wolfssl.c (tls_init): Likewise.
* src/options.c (struct config): Init ca_cert,
  (init): Allocate / dup config.ca_cert.

Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.d
2023-08-18 12:40:27 +02:00
f67ca61ab1 * src/options.c (print_version): Work around MSVC preprocessor issue 2023-08-18 10:44:34 +02:00
d0059f71b3 * src/wget.c: Silence -Wvla in gnulib regex.h 2023-08-03 14:44:35 +02:00
0b241b4a97 * src/wget.c: Replace VLA 2023-07-29 19:01:49 +02:00
0667570405 * src/utils.c: Replace VLA 2023-07-29 19:01:24 +02:00
3dc30f5f0c * src/blacklist.c (get_local_filename_real): Replace VLA 2023-07-29 19:01:17 +02:00
db1dc26cab Silence -Wvla when including gettext.h
* libwget/private.h: Disable -Wvla for #include <gettext.h>.
* src/wget_main.h: Likewise.
2023-07-29 19:01:12 +02:00
3bf44e3c00 Enable native VT support on windows (fixes cmdhost etc usages)
* libwget/console.c: New function SetupConsoleHandle(),
  (wget_console_init): Call SetupConsoleHandle().
* src/wget.c: New function is_tty(),
  (main): Call is_tty() instead of isatty().

disable progress bar if VT mode is not supported (unless force is used)
2023-07-29 17:20:09 +02:00
d72b05a70e Windows console width detection and update checks
* libwget/utils.c (wget_get_screen_size): Add implementation for _WIN32.
* src/bar.c (bar_update_thread): Add implementation for _WIN32.

Copyright-paperwork-exempt: Yes
Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de
2023-07-09 11:46:00 +02:00
0aec54142c Use after free fix around output document name (when colliding with existing)
* src/wget.c (get_header): Correctly set dest and name.

Copyright-paperwork-exempt: Yes
2023-07-08 16:23:22 +02:00
d70f520e16 In debug mode warn if progress=bar that the info logstream is turned off
* src/wget.c (main): Print info message if info logstream is turned off.

Copyright-paperwork-exempt: Yes
2023-07-08 16:17:08 +02:00
a4bba8b2cb Avoid setting non-supported options to remove log warnings
* src/options.c (init): Avoid superfluous calls to wget_ssl_set_config_int().

Copyright-paperwork-exempt: Yes
2023-07-08 16:08:21 +02:00
0ea7e10e7a Don't try to set file timestamps on ttys
Avoids errors to console.

* src/wget.c (set_file_mtime): Skip futimens if fd is a TTY.

Copyright-paperwork-exempt: Yes
2023-07-08 13:39:04 +02:00
279901855e Fix code to silence sc_gettext_printf
* libwget/http.c: Add _() around error messages where missing.
* libwget/net.c: Likewise.
* libwget/ssl_gnutls.c: Likewise.
* libwget/ssl_openssl.c: Likewise.
* src/wget.c: Likewise.
2023-07-08 13:00:40 +02:00
19a7070d86 Silence spell checker
* contrib/spell-checker: Add 'anull' to exclude list.
* libwget/ssl_gnutls.c: Fix verication to verification.
* src/options.c: Fix pysical to physical.
2023-07-02 18:32:46 +02:00
cf1020d745 * src/wget.c (add_urls): Improve recursive RSS/Atom processing 2023-07-02 18:08:24 +02:00
046452c1e4 * src/options.c (options[]): Fix arguments for --filter-urls
Reported as https://github.com/rockdaboot/wget2/issues/281 by @troy-daniel
2023-06-18 17:19:02 +02:00
6c777c8893 * src/wget.c (queue_url_from_remote): info_printf() instead of debug_printf() 2023-05-28 17:59:12 +02:00
84d0220e22 New option --dane
* 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'.
2023-04-23 19:49:12 +02:00
0684c0c143 Fix accidentally removing fragments when converting links.
* src/wget.c (convert_links): Take the link fragment from the IRI
  instead of blacklist entry.

Copyright-paperwork-exempt: Yes

Fixes #623
2023-03-11 10:40:43 +01:00
8489f73fda Fix duplicate downloads for Link headers with rel=duplicate
* src/wget.c (process_response_header): Remove check for 302+metalink,
  Use highest priority alternative link instead of Location,
  (process_response): Remove rel=duplicate code from metalink check.
2023-01-22 12:32:24 +01:00
edfd08b4c1 * src/wget.c (get_header): Fix segmentation fault (deref NULL) 2022-12-10 18:38:25 +01:00
b68b1179fe Add new option --follow-sitemaps
* docs/wget2.md: Add section for --follow-sitemaps.
* src/options.c (struct config config): Set follow_sitemaps = true,
  (options[]): Add "follow-sitemaps".
* src/wget.c (process_response): Only parse sitemaps if config.follow_sitemaps is set.
2022-12-03 19:46:52 +01:00
03c91040f6 * src/wget.c (queue_url_from_remote): Do some checks earlier 2022-10-31 19:59:07 +01:00
86da81199d * src/options.c (init): Switch progress bar off when using -o/--output-file 2022-10-31 11:34:34 +01:00
b89af6d0b8 Introduce XML function to decode entities
* include/wget/wget.h: Add wget_xml_decode_entities_inline().
* libwget/iri.c (iri_unescape_inline): Remove decoding of XML entities.
* libwget/xml.c: Add wget_xml_decode_entities_inline().
* src/wget.c (normalize_uri): Call wget_xml_decode_entities_inline().
2022-09-02 19:51:52 +02:00
94e9486ad1 * src/bar.c (bar_deinit): Fix segfault (joining not initialized thread) 2022-08-14 14:50:38 +02:00
9395dd4b79 Implement --check-certificate=quiet
* include/wget/wget.h: Add WGET_SSL_REPORT_INVALID_CERT macro
* libwget/ssl_gnutls.c: Change certificate related error_printf() calls, for error_printf_check()
* libwget/ssl_openssl.c: Consider the case WGET_SSL_REPORT_INVALID_CERT in wget_ssl_set_config_int()
* libwget/ssl_wolfssl.c: Change certificate related error_printf() calls, for error_printf_check()
* src/options.c: Admit quiet as a valid value on --check-certificate
* src/wget_options.h: Move check_certificate from bool to an enum type (with enabled, disabled and log_disabled as values)
2022-07-23 16:28:22 +02:00
7f2db0c398 Fix status code for 5xx errors
* src/wget.c (process_response_header): Set EXIT_STATUS_REMOTE on 5xx.
* tests/test-i-https.c: New test to check 503 behavior.
* tests/test-wget-1.c: Likewise.
2022-07-01 18:19:42 +02:00
44f1bb7c4c Remove memset() calls
* examples/batch_loader.c (main): Likewise
* examples/check_url_types.c (main): Likewise
* libwget/metalink.c (add_file_hash): Likewise
* src/wget.c (program_init): Likewise
2022-06-25 13:57:00 +02:00
8bbb852eca * src/wget.c (convert_links): Remove unused loop variable 2022-06-18 16:59:44 +02:00
f7fe3e78d2 * src/options.c (parse_progress_type): Improve Wget compatibility 2022-06-12 20:00:56 +02:00
d1f2858720 * src/options.c (config): Use PROGRESS_TYPE_BAR as default 2022-06-12 19:28:03 +02:00
5e76805748 Add defines for PROGRESS_TYPE_(BAR|NONE)
* src/bar.c: Make use of PROGRESS_TYPE defines.
* src/wget.c: Likewise.
* src/wget_bar.h: Define PROGRESS_TYPE_BAR and PROGRESS_TYPE_NONE.
2022-06-12 19:26:06 +02:00
e34a3aa7c2 * src/wget.c (downloader_thread): Only set EXIT_STATUS_NETWORK on error for the try 2022-04-03 15:09:52 +02:00
90d4f2ab57 * src/wget.c (add_urls): Amend info message 2022-04-03 13:16:27 +02:00
0f554ef216 * */Makefile.am: Reorder link libraries (libgnu.la first) 2022-03-05 16:23:15 +01:00
89a83274da * src/options.c (print_help): Fix warning about missing case in switch 2022-03-01 13:27:52 +01:00
a9105f20c0 * src/options.c (print_help): Remove unreachable code 2022-02-27 19:44:12 +01:00
215facd4e2 Fix storage files in help text and in the docs
* docs/wget2.md: Fix ~/.wget-* to $XDG_DATA_HOME/wget/.wget-*
* src/options.c: Likewise.
2022-02-25 19:02:44 +01:00
3dc7f71098 Update copyright year 2022-02-25 17:46:43 +01:00