* configure.ac: Suppress -Wunsuffixed-float-constants for gcc,
add -Wno-disabled-macro-expansion to clang flags
* examples/getstream.c: Removed 'unused' attributes from argc and argv.
* include/wget/wget.h: Fix slot to int for bar functions.
* libwget/bar.c: Fix slot to int for bar functions, cast to int,
change type of bitfield 'redraw' to unsigned.
* libwget/hsts.c (wget_hsts_new): Fix int to bitfield conversion.
* libwget/http.c: Cast printf %p format to (void *).
* src/wget.c: Cast printf %p format to (void *),
remove ACTION_DONE from enum actions.
* src/wget_host.h: Fix double declaration of host_remove_job()
* tests/libtest.c (wget_test_check_filesystem): Fix type of 'rc'.
* tests/test-idn-robots.c: Fix comma to semikolon at end of line.
* tests/test.c (test_strcasecmp_ascii): Fix type of loop variable.
* bootstrap.conf: Remove manywarnings, add warnings
* configure.ac: Replace manywarnings code
The new code works on recent gcc and clang with an overhead of
~100ms instead of ~9s here (without -C).
This is meant for developers only and is activated by either
--enable-gcc-warnings or by touching .manywarnings.
* src/options.c (parse_header): Fix bug where empty string did not clear
out all the headers
* src/options.c (selftest_options): Fix testcase for parse_header and
add more tests
* libwget/http.c (wget_http_create_request): Add 'Host' header
to header list,
(wget_http_send_request): Do not add 'Host' hard-coded,
(wget_http_request_to_buffer): Special treatment of 'Content-Length'
* src/wget.c (http_create_request): Replace wget's HTTP headers by
user-provided headers, except 'Cookie' headers which will be appended.
* src/options.c: Add new --header option and a new parse_header()
parsing function for that. Also add self tests for parsing
* src/wget_options.h: Same
* src/wget.c (http_create_request): Add the user added headers to the
HTTP Request
* src/test-wget-1.c: Add a test for the --header option
* libwget/bar.c: Fix typos,
(wget_bar_set_slots): Init mem only when needed,
add comments describing Escape sequences
* src/bar.c (bar_update_slots): Take nslots as param
* src/wget.c: Move call to bar_update_slots() from worker to main thread
* src/wget_bar.h: Amend prototype of bar_update_slots()
* .travis.sh: Rewrite for clarity and speed. Testing shows that valgrind
and ASan don't play well together. So split their executions.
* .travis.yml: Enable ccache for builds. Also try to update libc6 if
possible
* .travis.yml: Do not run on OSX with CC=gcc. This is because on OSX,
gcc is only a wrapper around clang.
* .travis_setup.sh: Cosmetic changes only
* Makefile.am (check-coverage): Explcicitly disable valgrind tests when
checking coverage
* tests/libtest.c (wget_test): Use a provided suppressions file for
valgrind. This is required since the valgrind version on Travis seems to
be out of sync with libc. This causes valgrind to report a memory bug
falsely.
* tests/valgrind-suppressions: New file with some valgrind suppressions.
Included suppressions are for a valgrind/libc bug and to suppress
reachable memory messages from within gnutls
* include/wget/wget.h: wget_get_screen_size() must not be pure
* libwget/bar.c (_bar_get_width): Leave one space right to avoid linebreaks
* libwget/utils.c (wget_human_readable): Align # of bytes
* src/bar.c (wget_get_screen_size): Fix return value
* include/wget/wget.h: New function wget_get_screen_size. Replaces old
wget_determine_screen_width
* libwget/bar.c (_bar_get_width): Use wget_get_screen_size instead of
wget_determine_screen_width
* libwget/utils.c: Replace function wget_determine_screen_width with a
more generic wget_get_screen_size.
* include/wget/wget.h: New function wget_bar_screen_resized, as an
indicator that the screen size may have changed. Also, wget_bar_update
may now modify the *bar parameter
* libwget/bar.c: Move detection code for screen size into a separate
function called _bar_get_width.
(wget_bar_update): Check if the screen width has changed and
reallocate more space if necessary
* src/wget.c: Install a new signal handler for SIGWINCH
* include/wget/wget.h: Declare new function wget_determine_screen_width.
Also change prototype of wget_bar_init to not accept a max_width
parameter
* src/utils.c: Move function determine_screen_width from here ...
* libwget/utils.c: ... to here.
* src/utils.{c,h}: Delete empty file
* src/Makefile.am: Remove source files utils.{c,h}
* src/bar.c: Move detection of screen width from here ...
* libwget/bar.c: ... to here
* tests/test.c: wget_bar_init() no longer takes a max_width parameter
* include/wget/wget.h (_wget_bar_ctx): Remove unused elements
expected_size and filename. Rename slotpos to _slotpos to reflect that
it should not be used by the client.
* include/wget/wget.h: Remove declaration for old API functions
bar_register and bar_deregister. Define declarations for
wget_bar_slot_begin, wget_bar_slot_register and
wget_bar_slot_deregister.
* libwget/bar.c (_bar_slot_status_t): Define new enum to store the
status of a slot of the progress bar.
(_bar_slot_t): Remove unused element last_ctx. Also, define slot
elements: filename, file_size, bytes_downloaded and status.
(wget_bar_slot_begin): Define new function. Invoked when the client
has started downloading a new file.
(wget_bar_slot_register): New function to register a new file in a
progress bar slot.
(wget_bar_deregister): Remove old function
(wget_bar_slot_deregister): New function, called after file has
finished downloading. Successfully or unsuccessfully.
(wget_bar_deregister): Remove old function
(_bar_set_progress): last_ctx is no longer used. Instead data is
stored within the slot struct itself
(_bar_update_slot): Same
(_bar_print_final): Same
(wget_bar_deinit): Free the filename stored in the slot
* src/bar.c: Edit to reflect the changes in libwget API
* src/wget.c (_get_header): Same
(http_send_request): Same
(http_receive_response): Same
* src/wget_bar.h: Same
The mutex stdout was meant to ensure that multiple routines don't write
to the screen concurrently. However, this mutex is not required, since
such syncronization should be handled by the client using the library.
All other library methods for the progress avoid any form
synchronization primitives for this reason
* libwget/cookie.c (_compare_cookie{,2}): Mark as pure
* libwget/encoding.c (_utf8_is_valid): Same
* libwget/hsts.c (_compare_hsts): Same
* libwget/ocsp.c (_compare_ocsp): Same
* libwget/netrc.c (_compare_netrc): Same
* libwget/tls_session.c (_compare_tls_session): Same
* libwget/http.c: Add streamid to debug messages
* src/progress.h: Remove member downloader and head from _body_callback_context
* src/wget.c (downloader_thread): Keep track of locking,
(_get_header): Remove reference to downloader,
(http_send_request): Replace downloader with job
With HTTP/2 pipelining (parallel streams per connection) is active.
The bug fixed stops file descriptor leaks and writing data into wrong
files.