* 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.
* .gitignore: New entry examples/http_multi_get
* Makefile.am: Move subdir 'examples' before 'src'
* examples/Makefile.am: Add http_multi_get
* examples/http_get2.c (main): Adapt code to API changes
* examples/http_multi_get.c: New example to show async/parallel
requests
* examples/websequencediagram.c (main): Adapt code to API changes
* include/libwget.h.in: New functions wget_http_request_set_header_cb,
wget_http_request_set_body_cb, wget_http_request_set_int.
Changed params of wget_http_get_response.
Removed wget_http_get_response_func, wget_http_get_response_stream,
wget_http_get_response_fd.
Changed params of wget_http_get_response_cb.
Add members pending_requests, received_http2_responses,
pending_http2_requests to wget_http_connection_t.
Add member req to wget_http_response_t.
Add members header_callback, body_callback, header_user_data,
body_user_data, response_keepheader to wget_http_request_t.
New function types wget_http_header_callback_t and
wget_http_body_callback_t.
* libwget/http.c: Implementation of the changes in include/libwget.h.in.
* libwget/http_highlevel.c: Adapt code to API changes
* libwget/ssl_gnutls.c: Fixed defaults for SNI, OCSP and
ALPN.
Adapt code to API changes.
* src/options.c: Reflect changes in libwget/ssl_gnutls.c
* src/wget.c: Adapt code to API changes
* autogen.sh: Add gnulib module 'c-strcasestr'
* examples/getstream.c: Support several playlist formats
getstream.c now supports .m3u, .wax, .asx, .pls, xspf playlist formats.
Playlist parsing is partly hackish - it is just an example after all.
The title information is displayed on stderr, the audio goes to stdout to
allow piping to mpg321, sox, etc. For details see the top comment in the
source file.
* examples/print_html_urls.c (html_parse_localfile):
Detect BOM (Byte Order Mark), convert UTF-16 to UTF-8 before parsing.
* include/libwget.h.in: Remove wget_charset_transcode(),
add wget_memiconv() and wget_striconv().
* libwget/encoding.c: Implement wget_memiconv() and wget_striconv()
* src/wget.c (html_parse): Add 'html_len' param,
convert UTF-16 to UTF-8 before parsing.
* tests/test.c: New test for wget_memiconv().
* examples/websequencediagram.c: New file
* examples/websequencediagram_high.c: New file
* examples/Makefile.am: Add websequencediagram[_highlevel]
These examples show how to do two requests on one connection,
a POST and a GET, saving the downloaded body to disk.
websequencediagram uses the low-level API.
websequencediagram_highlevel uses the high-level API.
Cookies: Add new function wget_cookie_set_keep_session_cookies()
and adjust wget_cookie_db_load() and wget_cookie_db_save().
Use wget_update_file() for loading and saving.
* examples/getstream.c, examples/print_css_urls2.c, libwget/cookie.c,
libwget/css_url.c, libwget/encoding.c, libwget/hsts.c,
libwget/html_url.c, libwget/http.c, libwget/metalink.c,
libwget/ocsp.c, libwget/robots.c, libwget/ssl_gnutls.c,
src/options.c, src/wget.c, tests/stringmap_perf.c,
tests/test-wget-1.c
Strndup() calls an additional strlen() on the input string.
This is normally not needed, and thus just consumes CPU cycles.
All calls to strndup() could be replaced by wget_strmemdup, which
basically allocates len+1 memory, calls memcpy and terminates with
a 0 byte.