4f557e8121
Mew test test-redirection-loop
...
* tests/Makefile.am: Add test-redirection-loop to tests
* tests/libtest.c (_http_server_thread): Check scope of requested URL,
skip check for expected files when not specified
* tests/libtest.h: Add wget_test_url_t.scope,
define WGET_TEST_URL_SCOPE_HTTP and WGET_TEST_URL_SCOPE_HTTPS
* tests/test-redirection-loop.c: New test file
2017-05-16 21:31:32 +02:00
750d34e213
Remove redundant VGSUPPFILE macro
...
* tests/Makefile.am: Remove VGSUPPFILE macro from libtest.la
* tests/libtest.c: Replace VGSUPPFILE with an expression using SRCDIR
2017-05-12 00:21:01 +05:30
1b3a28f740
* tests/libtest.c: Use --no-proxy for wget2 invocation in test-suite
2017-05-03 11:56:20 +02:00
5687254219
Amend --http-proxy and --https-proxy behavior
...
* libwget/http.c (_parse_proxies): Alloc vector on demand
* src/options.c (wget_http_set_http_proxy): Return # of proxies
successfully parsed,
(wget_http_set_https_proxy). Likewise.
* src/options.c (init): Empty and undefined proxy variable is the same.
* tests/test.c (test_set_proxy): Amend tests.
2017-05-02 10:53:03 +02:00
569a646876
Remove unnecessary while loop & add test
...
* libwget/http.c (_parse_proxies): Remove non-required `while`
* tests/test.c (test_set_proxy): Add test with leading whitespaces
2017-05-02 10:39:57 +02:00
88cc3ead0f
Add tests for wget_http_set_http(s)_proxy() functions
...
* tests/test.c (test_set_proxy): Add tests for wget_http_set_http_proxy()
* tests/test.c (test_set_proxy): Add tests for wget_http_set_https_proxy()
* libwget/http.c (wget_http_set_http_proxy): Return length of http_proxies if no parse error
* libwget/http.c (wget_http_set_https_proxy): Return length of https_proxies if no parse error
2017-05-02 10:36:11 +02:00
c6ee3d79ad
Fix syntax-check 'sc_prohibit_have_config_h'
...
* cfg.mk: Remove sc_prohibit_have_config_h from local-checks-to-skip
* libwget/*.c: Include <config.h> unconditionally
* src/*.c: Likewise
* tests/*.c: Likewise
2017-04-30 22:01:34 +02:00
b3aede0e57
Remove gnulib dependencies from examples and wget.h
...
* cfg.mk: Add examples as excludes for config.h
* examples/Makefile.am: Remove -I to srcdir and builddir
* examples/*.c: Remove #include <config.h>
* include/wget/wget.h: Remove gettext include and defines
* libwget/private.h: Add gettext include and defines
* src/wget_main.h: Likewise
* tests/libtest.h: Likewise
* src/log.c: Add #include <string.h>
2017-04-30 21:37:39 +02:00
59f163cd7b
Remove useless cpp parens (syntax-check)
2017-04-29 20:56:57 +02:00
56efdab1a7
Remove trailing whitespaces (syntax-check)
2017-04-29 20:51:32 +02:00
bc06128232
Fix space-tab sequences (syntax-check)
2017-04-29 20:40:14 +02:00
c1dee14c72
Spell filesystem 'file system' (syntax-check)
...
* docs/wget2_manual.md: filesystem -> file system
* tests/libtest.c: Likewise
* tests/libtest.h: Likewise
* tests/test-wget-1.c: Likewise
2017-04-29 19:41:15 +02:00
dba2663197
Fix --chunk-size with missing Content-Length
...
* src/wget.c (process_head_response): Don't release job after HEAD
* tests/libtest.c: Implement WGET_TEST_SERVER_SEND_CONTENT_LENGTH
* tests/libtest.h: Define WGET_TEST_SERVER_SEND_CONTENT_LENGTH
* tests/test-wget-1.c: Add new tests for --chunk-size
2017-04-21 12:49:34 +02:00
8f0aa96537
Hide wget_cookie_st
...
* include/wget/wget.h: Remove struct wget_cookie_st declaration,
add wget_cookie_to_setcookie(),
add wget_cookie_parse_setcookie(),
change wget_http_parse_setcookie() cookie param.
* libwget/cookie.c: Add struct wget_cookie_st declaration,
(wget_cookie_init): Use xcalloc(),
(wget_cookie_to_setcookie): New function,
(wget_cookie_parse_setcookie): New function,
(_wget_cookie_normalize_cookie): Fix host_only flag.
* libwget/http.c (wget_http_parse_setcookie): Code moved to
wget_http_parse_setcookie(),
(wget_http_parse_response_header): Amend cookie handling.
* tests/test.c (test_cookies): Amend test code and test data.
2017-04-20 16:02:18 +02:00
4ebedef9cd
Fix -c --chunk-size if the file is already complete
...
* src/wget.c (process_response_header): Check for status 416
* tests/test-wget-1.c: Added 2 tests
2017-04-15 12:42:38 +02:00
f56c167a61
Added settings --cut-url-get-vars and --cut-file-get-vars and fixed --backups
...
* docs/wget2_manual.md: Added doc for the new settings
* src/options.c: Fixed --backups and added --cut-url-get-vars and --cut-file-get-vars
* src/wget.c: Added --cut-url-get-vars and --cut-file-get-vars
* src/wget_options.h: Added --cut-url-get-vars and --cut-file-get-vars
* tests/Makefile.am: Added test-cut-get-vars
* test-cut-get-vars.c: New file
2017-04-13 21:41:53 +02:00
6214291e3b
Fixed crash in convert-links code introduced with html css parsing
...
* include/wget/wget.h: Removed unused variable.
* libwget/html_url.c: Updated code to always return pointer inside "html" variable.
* test/test-k.c: Updated test to cover the bug.
2017-04-13 19:58:10 +02:00
31762cc633
Added support for html css style tag and attribute
...
* include/wget/wget.h: Add 'size_t len' to wget_css_parse_buffer()
and wget_css_get_urls()
* libwget/css.c (wget_css_parse_buffer): Use yy_scan_bytes() instead
of yy_scan_string()
* libwget/css_url.c: Add param to wget_css_get_urls() and
wget_css_parse_buffer()
* libwget/html_url.c: Add _css_parse_encoding() and _css_parse_uri(),
(_html_get_url): Deal with 'style' attribute,
(wget_html_free_urls_inline): Free url if needed
* libwget/test_linking.c: Add param to wget_css_parse_buffer()
* libwget/xml.c (parseXML): Add check for 'style'
* src/wget.c (css_parse): Add param 'size_t len'
* tests/Makefile.am: Add new test test-parse-html-css
* tests/test-parse-html-css.c: New file
2017-04-13 10:06:25 +02:00
dd2f4b50e9
Follow link:rel=preload with --page-requisites
...
* libwget/html_url.c (_html_get_url): Add rel=preload to be followed
* tests/test--page-requisites.c: Add a test href for rel=preload
2017-04-12 16:34:11 +02:00
a83becf4de
Fix --page-requisites <link> handling
...
* libwget/html_url.c: Add helper ctx->uri_index,
fix "icon shortcut" -> "shortcut icon",
fix check for "stylesheet"
* src/wget.c (html_parse): Check for !html_url->link_inline
* tests/test--page-requisites.c: Add 'not.txt' URL and reference
2017-04-12 16:14:39 +02:00
f5ccda5e38
Add special HTML to test--page-requisites.c
...
* tests/test--page-requisites.c: Add HTML code
With --page-requisites shortcut icons should not be followed.
Link with rel="stylesheet" should be followed.
2017-04-12 15:28:16 +02:00
cd21cbcd74
* tests/test-cut-dirs.c: Add more tests
2017-04-12 11:12:59 +02:00
320ac40487
Fix --cut-dirs
...
* src/wget.c (get_local_filename): Add / after host part
* tests/Makefile.am: Add new test 'test-cut-dirs'
* tests/test-cut-dirs.c: New file
2017-04-12 10:17:46 +02:00
f00a7574f6
* tests/libtest.c (_ftp_server_thread): Remove redundant check for WIN64
2017-04-11 14:40:47 +02:00
bae35d7790
Prevent wget2rc from being read during tests
...
* src/options.c: Treat parse_filename{,s} as string vectors and clear
them with a no-* command line option
* tests/libtest.c: Pass --no-config to all the tests by default
2017-04-11 11:54:50 +02:00
4ad6d68305
Fix libraries to use libtool variables
...
* examples/Makefile.am: Use $(LTLIBICONV) $(LTLIBINTL) $(LTLIBTHREAD)
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
2017-04-06 12:25:07 +02:00
89a5245cfc
* tests/test.c: Add wget_robots_parse unit test
2017-04-04 12:29:45 +02:00
82d6c6d5dd
* tests/test-metalink.c: Free allocated memory to satisfy leak sanitizer
2017-03-30 21:04:33 +02:00
b4e151272c
Fix VPATH issue for test suite
...
* tests/Makefile.am: Set SRCDIR to $(abs_srcdir)
* tests/libtest.c: Remove '../' in front of SRCDIR
* tests/test-i-https.c: Likewise
Reported-by: Akash Rawal
2017-03-30 11:53:03 +02:00
874ce8dcdc
Fix path of valgrind-suppressions in vpath build
...
* tests/Makefile.am: For libtests.la, define VGSUPPFILE to absolute path to
tests/valgrind-suppressions
* tests/libtest.c: Use VGSUPPFILE macro instead of hardcoded path to
valgrind-suppressions
2017-03-30 00:41:35 +05:30
7d2eb91b1c
Skip IDNA tests when IDNA not available
...
* libwget/encoding.c: Fix #ifdef
* tests/test-idn-cmd.c: Skip if IDNA not available
* tests/test-idn-meta.c: Likewise
* tests/test-idn-robots.c: Likewise
* tests/test.c (test_iri_parse): Skip IDN test
2017-03-27 21:51:42 +02:00
4d7238e282
Fix vpath builds
...
* examples/Makefile.am: Add -DWGETVER_FILE to AM_CPPFLAGS
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
* include/wget/wget.h: Include WGETVER_FILE if defined
2017-03-25 20:49:41 +01:00
62a41fbd2d
Fix regression regarding chunked transfer-encoding
...
* libwget/http.c (wget_http_get_response_cb): Save data when chunk
complete in one data packet.
* tests/Makefile.am: Add new test 'test-chunked'
* tests/test-chunked.c: New test
2017-03-25 20:35:05 +01:00
12d4cafa2d
Fix chunk overflow in HTTP download for 32bit systems
...
* libwget/http.c: Check for pointer overflow
* tests/test-bad-chunk.c: Adjust tests
Reported-by: Dagobert Michelsen
2017-03-23 11:25:21 +01:00
bca903813c
* tests/test-k.c: Test link within <script> tag
2017-03-13 10:00:53 +01:00
d7385604b5
Check for invalid 'BASE' URLs in HTML
...
* src/wget.c (html_parse): Check if 'base' parses correctly
* tests/test-base.c: Add test with invalid base URL
2017-03-09 11:37:49 +01:00
0c6cf2a630
Fix .netrc parsing
...
* include/wget/wget.h (_wget_netrc_db_st): Rename .key to .host
* libwget/netrc.c (wget_netrc_db_add): Fix parsing
* tests/test.c: New function test_netrc()
2017-03-07 13:17:46 +01:00
7d8539eca0
* tests/test.c: Remove call of wget_hpkp_set_port()
2017-03-04 18:59:28 +01:00
e01926d2e2
Allow new 'expires' format for Set-Cookie header
...
* libwget/http.c (wget_http_parse_full_date): Allow format
'1 Mar 2027 09:23:12 GMT'
* tests/test.c (test_cookies): Test new format
2017-03-03 10:45:01 +01:00
07b4c4623e
Fix URL encoding issue in requests
...
* libwget/iri.c (wget_iri_escape_query): Do not escape ampersand,
(wget_iri_get_escaped_resource): Use wget_iri_escape_query()
* tests/test-base.c: Add test URLs with spacing in path, query and param
2017-02-28 17:02:35 +01:00
ec396c577f
Fix URLs to HTTPS where possible
2017-02-28 15:31:30 +01:00
12cc9ef1e6
Fix charset conversion for HTML parsing
...
* src/wget.c: New helper function _normalize_uri()
(sitemap_parse_text): Check size before allocating stack space
* tests/Makefile.am: Add test-iri-subdir
* tests/test-iri-subdir.c: Add new test
2017-02-23 16:20:51 +01:00
364ebfd4b2
Remove HPKP entries with zero PINs
...
* libwget/hpkp.c (wget_hpkp_db_check_pubkey): Fix subdomain default,
(wget_hpkp_db_add): Remove entry on zero PINs
* src/wget.c: Remove comment line
* tests/test.c (test_hpkp): Test this feature
2017-02-22 13:16:40 +01:00
2b448ffa92
Fix memleak in HPKP
...
* include/wget/wget.h: Changed declaration of wget_hpkp_free()
* libwget/hpkp.c: Use wget_hpkp_free() as destructor function
* libwget/http.c (wget_http_free_hpkp_entries): Amended
* tests/test.c: Fix typos
2017-02-22 13:16:40 +01:00
7f436e9fbe
* tests/certs/README: Add info on how to create pin-sha256 values for HPKP
2017-02-22 13:16:40 +01:00
b991db695f
* tests/test.c: Add unit testing for HPKP
2017-02-22 13:16:40 +01:00
295fbdaf80
* tests/test.c (test_buffer): Add more tests
2017-02-21 17:03:26 +01:00
0a9ee00db9
Fix possible file name truncation
...
* tests/test-parse-html.c: Increase buffer for filename
* tests/test.c: Likewise
2017-02-01 11:19:52 +01:00
bfcd65c12b
Use typedefs for function pointer arguments
...
* include/wget/wget.h: Add typedefs
* libwget/cookie.c: Use typedefs
* libwget/css.c: Likewise
* libwget/css_url.c: Likewise
* libwget/decompressor.c: Likewise
* libwget/hashmap.c: Likewise
* libwget/hsts.c: Likewise
* libwget/http.c: Likewise
* libwget/init.c: Likewise
* libwget/io.c: Likewise
* libwget/list.c: Likewise
* libwget/logger.c: Likewise
* libwget/metalink.c: Likewise
* libwget/net.c: Likewise
* libwget/netrc.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/private.h: Likewise
* libwget/robots.c: Likewise
* libwget/stringmap.c: Likewise
* libwget/tls_session.c: Likewise
* libwget/vector.c: Likewise
* libwget/xml.c: Likewise
* src/blacklist.c: Likewise
* src/host.c: Likewise
* src/options.c: Likewise
* src/wget.c: Likewise
* tests/stringmap_perf.c: Likewise
* tests/test.c: Likewise
2017-01-23 14:43:17 +01:00
27448004c1
* tests/stringmap_perf.c: Use wget_malloc if mmap not available
2017-01-06 12:14:16 +01:00