* include/wget/wget.h (struct wget_iri_st): Remove uri_allocated.
* libwget/iri.c (wget_iri_free_content): Do not free iri->uri,
(wget_iri_clone): Simplify code and do not heap-allocate iri->uri.
* include/wget/wget.h: New function declaration wget_http_connection_receive_only().
* libwget/http.c: New function definition wget_http_connection_receive_only().
* libwget/http.h (struct wget_http_connection_st): Add member goaway.
* libwget/http2.c (struct http2_stream_context): Add member conn,
(on_frame_recv_callback): Handle NGHTTP2_GOAWAY,
(wget_http2_send_request): Initialize conn member.
* src/host.c (_release_job): Don't release parts if in 'done' state.
* src/wget.c (process_response_header): Remove handling of LINK headers,
(process_response): Add handling of LINK headers,
(downloader_thread): Handle pending responses correctly.
This patch fixes two related issues:
1. With HTTP/2, servers sometimes limit the number of requests per connection.
Beforethis patch, the connection was closed too early after GOAWAY and pending
responses weren't received.
2. In _release_job(), already downloaded parts of a file were erroneous released.
This caused successful metalink and chunked downloads to fail in combination with
a GOAWAY or a remotely closed connection.
* libwget/http.c: Add function wget_http_cidr_match to support
CIDR IP method for no_proxy
* unit-tests/test.c: Add testcases to verify the functionality
of the above function
Fixes#615
* 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'.
* 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)
* include/wget/wget.h: Remove function wget_iri_isunreserved_path().
* libwget/iri.c: Remove function wget_iri_isunreserved_path().
(iri_ctype): Extend array with unreserved characters.
(wget_iri_isunreserved): Simplify code.
(wget_iri_escape): Use macro iri_isunreserved instead of wget_iri_isunreserved().
(wget_iri_escape_path): Add RFC links to function comment,
Fix check whether char needs percent-encoding or not,
Use macro iri_isunreserved instead of wget_iri_isunreserved().
* include/wget/wget.h: Set return type of wget_strmemcpy to size_t.
* libwget/mem.c (wget_strmemcpy): Return length of destination string.
* unit-tests/test.c: Amend tests of wget_strmemcpy.
* include/wget/wget.h: Make metalink->iri 'const'
* libwget/metalink.c (add_mirror): Code cleanup
* src/wget.c (establish_connection): Skip HTTP mirrors if HTTPS requested,
(queue_url_from_local): Lock mutex a bit later
* include/wget/wget.h (wget_tls_stats_data): Change type of tfo and false_start to bool
* libwget/ssl_gnutls.c: Use bool in _session_context,
remove use of !!
* include/wget/wget.h: Likewise
* libwget/net.c: Likewise
* libwget/init.c (wget_global_init): Fix param type to wget_tcp_set_tcp_fastopen()
* src/wget_options.h (struct config): Change type of tcp_fastopen to bool
* include/wget/wget.h: Change param to bool in wget_hsts_db_add_fn(),
(struct wget_http_response_st): Use bool for hsts_include_subdomains and keep_alive,
change param to bool in wget_http_parse_strict_transport_security(),
change param to bool in wget_http_parse_connection()
* libwget/hsts.c: change param to bool in new_hsts(),
change param to bool in wget_hsts_db_add()
* libwget/http_parse.c: change param to bool in wget_http_parse_strict_transport_security(),
change param to bool in wget_http_parse_connection()
* tests/test-plugin-dummy.c: change param to bool in test_hsts_db_add()
* unit-tests/test.c (test_hsts): Change type of include_subdomains to bool
* include/wget/wget.h: Change second param of wget_cookie_set_keep_session_cookies() to bool
* libwget/cookie.c: Likewise
* libwget/init.c (struct _CONFIG): Use bool for cookies_enabled, keep_session_cookies