* src/wget.c (convert_links): process URL the same way as in normalize_uri().
* tests/Makefile.am: Add new test file test-k-percent-encoding.c.
* tests/test-k-percent-encoding.c: New file.
In src/blacklist.c:get_local_filename_real(), the stack/heap selection for
fname_esc was inverted, so the code used `char tmp[1024]` exactly when the
required size is >1024, leading to stack corruption when
wget_restrict_file_name() writes into it.
This was introduced by commit 3dc30f5f0c.
Reported-by: Arkadi <arkadva8@gmail.com>
* Makefile.am: Run tests of GnuTLS is available.
* configure.ac: Add conditional WITH_GNUTLS_IN_TESTSUITE,
add check for SSLv2_client_method().
* libwget/ssl_wolfssl.c (wget_ssl_init): Silently fall back to
SSLv3 if SSLv2 is requested but not available.
This adds extensive HTTP/2 test coverage using libnghttp2 as the test
server, covering multiplexing, stream error handling, connection
management, and settings negotiation.
* tests/libtest.h (wget_test_url_t): Add h2_delay_response and
h2_rst_stream_error fields for HTTP/2 test control.
(WGET_TEST_H2_MIN_CONCURRENT_STREAMS): New test flag.
(wget_test_get_h2_server_port): Declare function.
* tests/libtest.c: Remove HAVE_MICROHTTPD_HTTP2_H infrastructure,
(h2_session_data, h2_server_t): New structures for libnghttp2 server,
(h2_send_callback, h2_recv_callback): Implement nghttp2 I/O callbacks,
(h2_on_frame_recv_callback): Handle HTTP/2 frames,
(h2_on_header_callback): Process request headers,
(h2_data_read_callback): Stream response body with 8KB chunk limit,
(h2_on_stream_close_callback): Clean up stream resources,
(h2_session_data_new, h2_session_data_free): Manage session lifecycle,
(h2_server_thread): Main server loop with TLS and ALPN support,
(h2_server_start, h2_server_stop): Control server lifecycle,
(_http_server_stop): Remove gnutls_global_deinit() call to fix
server restart issues,
(wget_test_start_server_handler): Default start_h2 to 0 (opt-in),
enable HTTP/2 with WGET_TEST_H2_ONLY flag,
(wget_test): Skip H2_PASS when libnghttp2 unavailable,
(wget_test_get_h2_server_port): Return HTTP/2 server port.
* tests/Makefile.am (WGET_TESTS): Add test-http2-multiplexing,
test-http2-stream-errors, test-http2-connection-errors,
test-http2-settings.
* tests/test-http2-multiplexing.c: New file testing concurrent
downloads over single HTTP/2 connection with multiplexing.
* tests/test-http2-stream-errors.c: New file testing stream error
isolation with RST_STREAM frames.
* tests/test-http2-connection-errors.c: New file testing connection
recovery after server restart.
* tests/test-http2-settings.c: New file testing SETTINGS frame
exchange, header compression, and large headers.
* tests/test-limit-rate-http2.c (main): Skip 3-file multiplexed
download test when running with HTTP/2 due to rate limiting
limitations in test server.
The HTTP/2 test server uses libnghttp2 with GnuTLS for TLS and ALPN
negotiation. Tests verify protocol-specific features like multiplexing,
stream independence, and proper SETTINGS exchange. HTTP/2 is now opt-in
via WGET_TEST_H2_ONLY to avoid breaking existing tests.
* libwget/ssl_gnutls.c (ssl_writev): Only check errno on error.
* src/job.c (job_validate_file): Set errno explicitly to 0.
* src/utils.c (mkdir_path): Check a secure value of errno.
* src/wget.c (prepare_file): Likewise.
* libwget/base64.c (base64_encode): Drop explicit error length.
* libwget/buffer_printf.c (convert_pointer): Likewise.
Just cosmetics - allows to build with -Werror.
* 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.
* src/wget.c (process_head_response): Cast size_t to long long.
* src/wget_options.h (struct config): Change type of chunk_size from size_t to long long.
Reported-by: https://gitlab.com/uhle