930 Commits

Author SHA1 Message Date
5b7f015bd6 Add initial debian/ files 2017-01-25 10:33:59 +01:00
0fe5f9282d New function wget_logger_is_active()
* include/wget/wget.h: Add prototype
* libwget/Makefile.am: Add logger.h
* libwget/log.c: Include logger.h
* libwget/logger.c: Include logger.h, add wget_logger_is_active()
* libwget/net.c: Use wget_logger_is_active()
* libwget/private.h: Remove struct _wget_logger_st
2017-01-23 16:55: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
315c8f7516 base46: Use size_t as string length param 2017-01-20 16:23:02 +01:00
cd060b8a22 * src/wget.c (restrict_file_name): Fix clang warning 2017-01-20 16:14:19 +01:00
dfc4b53eae Add typedef for wget_vector_browse() callback function
* include/wget/wget.h: Add typedef wget_list_browse_cb_t
* libwget/list.c: Use wget_list_browse_cb_t
2017-01-19 17:11:58 +01:00
566e9f7c70 Add typedef for wget_update() callback functions
* include/wget/wget.h: Add typedef wget_update_cb_t
* libwget/cookie.c: Use wget_update_cb_t
* libwget/hsts.c: Likewise
* libwget/tls_session.c: Likewise
2017-01-19 17:11:58 +01:00
43a11b6c2a gnulib: Update 2017-01-18 20:23:04 +01:00
09b172dfc0 * libwget/io.c (wget_ready_2_transfer): Fix INF timeout for select() 2017-01-18 20:17:14 +01:00
e01761a835 Revert "* .travis_setup.sh: Install graphiz and libidn2 on OSX"
This reverts commit 31c287f2ce.
2017-01-18 20:16:21 +01:00
31c287f2ce * .travis_setup.sh: Install graphiz and libidn2 on OSX 2017-01-18 17:11:07 +01:00
3f7c54c01b Fix search for '-e' commands
* src/options.c (set_long_option): Fallback to unsharp linear search,
  (opt_compare_execute): Amend params.
2017-01-18 14:33:03 +01:00
5495dab56a Fallback to select() if poll() not available
* bootstrap.conf: Add module select
* libwget/io.c (wget_ready_2_transfer): Add fallback code
2017-01-18 11:15:24 +01:00
ffb1de90a8 * src/wget.c (http_receive_response): Small code cleanup 2017-01-18 11:00:20 +01:00
8248bfecd1 Add console color abstraction
* docs/Makefile.am: Add libwget-console.3
* include/wget/wget.h: Add console routines
* libwget/Makefile.am: Add libwget/console.c
* libwget/console.c: New file with console functions
* src/log.c: Add WIN32 and console function calls
2017-01-06 14:23:37 +01:00
1f39794852 Add function wget_truncate()
* bootstrap.conf: Ad gnulib module ftruncate
* include/wget/wget.h: Add wget_truncate
* libwget/io.c: Add wget_truncate
* src/job.c: Call wget_truncate instead of truncate

The truncate() function is not covered by gnulib.
wget_truncate() is a wrapper around ftruncate(), which is covered
by gnulib.
2017-01-06 12:14:40 +01:00
27448004c1 * tests/stringmap_perf.c: Use wget_malloc if mmap not available 2017-01-06 12:14:16 +01:00
b9e7f48612 * libwget/cookie.c (_cookie_db_save): Fix ferror() check
Reported-by: Gisle Vanem
2017-01-06 10:36:08 +01:00
92eb42ec04 * gnulib: Update 2017-01-06 10:29:10 +01:00
9dd781756b * libwget/Makefile.am: Add more libs to LDADD 2017-01-06 10:29:10 +01:00
eb6609289d * src/wget.c (downloader_thread): Slow down on connection errors 2017-01-06 10:29:10 +01:00
042065d44f Let MSVC compile libwget/init.c (wget_global_init)
Reported-by: Gisle Vanem
2017-01-05 22:13:46 +01:00
20f4ad1e5f * src/options.c (init): Call wget_net_init() 2017-01-05 15:45:36 +01:00
5582908092 Remove redundant check for _WIN64 2017-01-05 12:18:56 +01:00
0354295e03 Add network init function to bootstrap sockets on Windows
* bootstrap.conf: Add gnulib module 'sockets'
* examples/http_get2.c: Call wget_net_init()
* include/wget/wget.h: Add wget_net_init() and wget_net_deinit()
* libwget/init.c (wget_global_init): Call wget_net_init(),
  (wget_global_deinit): Call wget_net_deinit()
* libwget/net.c: Add wget_net_init() and wget_net_deinit()
2017-01-05 12:09:25 +01:00
43f30f309e Rename wget_str_[v]asprintf to wget_[v]aprintf
* include/wget/wget.h: Rename wget_str_[v]asprintf to wget_[v]aprintf
* libwget/http.c: Likewise
* libwget/iri.c: Likewise
* libwget/printf.c: Likewise
* libwget/vector.c: Likewise
* src/options.c: Likewise
* tests/test-metalink.c: Likewise
2016-12-21 11:54:36 +01:00
5f6b0b29a6 Adjust GnuTLS priorities
* libwget/ssl_gnutls.c (wget_ssl_init): Use system defaults for
  secure_protocol "auto".
  (wget_ssl_open): Set compatibility mode for "auto".
2016-12-21 11:44:23 +01:00
f240b0002a * libwget/cookie.c (wget_cookie_db_init): Fix argument of psl_latest() 2016-12-21 11:23:00 +01:00
40b8da056e Reduce redundant code by using strchrnul()
* bootstrap.conf: Add gnulib module strchrnul
* libwget/http.c (_parse_proxies): Remove redundant code
* libwget/ssl_gnutls.c (wget_ssl_open): Likewise
2016-12-16 15:41:58 +01:00
6f1ea87ad2 * docs/wget2_manual.md: Add description for --config-file 2016-12-16 15:00:19 +01:00
a9e8b97a24 Read $SYSTEM_WGET2RC, $WGET2RC and ~/.wget2rc as config file
This patch separates the config files of wget and wget2.
Config files are read in the order they appear on the command line.

Fixes #132
2016-12-16 14:40:57 +01:00
d3a5cbc2e7 * src/options.c (parse_stringlist): Remove redundant code 2016-12-16 11:23:27 +01:00
582bc2890a * libwget/thread.c: Return a value in dummy wget_thread_cancel()
Reported-by: Gisle Vanem
2016-12-15 11:22:22 +01:00
3620354150 * src/wget.c (process_response): Ignore sitemaps with --page-requisites 2016-12-14 20:51:33 +01:00
2adf54dd14 * src/options.c (selftest_options): Clear config.headers before and after use 2016-12-13 21:11:22 +01:00
a6c2503a9b * src/options.c: Relax CLI and config file parser regarding spaces 2016-12-13 20:48:04 +01:00
38f0905f2f Take advantage of libpsl 0.16+
* libwget/cookie.c (wget_cookie_db_init): Use psl_latest() if possible
2016-12-12 15:59:48 +01:00
6286482849 * tests/test-bad-chunk.c: Remove WGET_TEST_KEEP_TMPFILES 2016-12-03 23:04:28 +01:00
6162f84c9d Add tests with bad chunk size in the HTTP response
* tests/Makefile.am: Add test-bad-chunk.c
* tests/test-bad-chunk.c: New file with 3 tests
2016-12-02 17:54:09 +01:00
82bd6fee89 * libwget/http.c: Ignore Transfer-Encoding for HTTP/2 requests 2016-12-02 16:41:25 +01:00
6b2d929617 * src/options.c: Respect WGETRC and SYSTEM_WGETRC env vars 2016-11-30 17:33:05 +01:00
74395dba94 * docs/wget2_manual.md: Update description of -O 2016-11-16 13:01:04 +01:00
909afd75fc Make the visibiity attribute preceed the prototype
* include/wget/wget.h: Make library symbol export attribute
((__visibility__)) preceed the function prototype to work on Windows
with MSVC
* tests/libtest.h: Same

Reported-by: Gisle Vanem
2016-11-16 12:03:27 +01:00
ecbfea77c0 Rename LIBWGET_EXPORT to WGETAPI
* include/wget/wget.t: Rename LIBWGET_EXPORT to WGETAPI
* tests/libtest.h: Same
2016-11-16 11:45:46 +01:00
fe967f4817 Export symbols only from wget.h
* libwget/iri.c: Move exporting of symbol wget_iri_schemes from here
* include/wget/wget.h: To here
2016-11-16 11:16:58 +01:00
ba365efd0d Replace x{malloc,calloc} calls with wget_* methods
* include/wget/wget.h: Remove preprocessor definitions for xmalloc,
xcalloc and xrealloc
* src/job.c(job_validate_file): Replace xcalloc with wget_calloc
* src/wget.c(main): Same
(process_head_response): Same
(_prepare_file): Same
(http_send_request): Same
2016-11-16 11:06:25 +01:00
0117ec4ff5 Fix integer overflow in ratio calculation
* libwget/bar.c (_bar_update_slot): Fix integer overflow in ratio calculation

Fixes #125
2016-11-15 15:12:41 +01:00
5ac6721078 Fix timestamp in If-Modified-Since header
* src/wget.c(http_create_request): Use mtime instead of mtime+1

According to RFC 7238, section 3.3, an origin server may use exact
timestamp matching to implement conditional requests. Hence, Wget must
not modify the mtime at all
2016-11-15 14:27:41 +01:00
16a13f393f * src/bar.c (bar_init): Disable progress bar if threading is not available 2016-11-15 14:16:16 +01:00
37b732f95a * libwget/bar.c (_bar_set_progress): Typecast the right value to integer 2016-11-12 16:00:40 +01:00