3dc7f71098
Update copyright year
2022-02-25 17:46:43 +01:00
20a6046fca
Fix issue reported by scan-build
...
* include/wget/wget.h: /// -> //.
* libwget/netrc.c (unescape_password): Check wget_malloc() return against NULL.
* libwget/xml.c (wget_xml_parse_file): Likewise.
2022-02-19 14:35:40 +01:00
01a6fe02e3
Fix request path escaping
...
* include/wget/wget.h: Remove function wget_iri_isunreserved_path().
* libwget/iri.c: Remove function wget_iri_isunreserved_path().
(iri_ctype): Extend array with unreserved characters.
(wget_iri_isunreserved): Simplify code.
(wget_iri_escape): Use macro iri_isunreserved instead of wget_iri_isunreserved().
(wget_iri_escape_path): Add RFC links to function comment,
Fix check whether char needs percent-encoding or not,
Use macro iri_isunreserved instead of wget_iri_isunreserved().
2021-05-16 14:29:26 +02:00
22162f82b2
Update copyright year
2021-01-22 21:58:38 +01:00
f270997432
* include/wget/wget.h (wget_hsts_host_match_fn): Fix argument names (cppcheck)
2020-03-17 16:49:35 +01:00
ef40fb5221
Parse HTML download attribute
...
* examples/print_html_urls.c: Print download attribute.
* include/wget/wget.h (wget_html_parsed_url): Add download member.
* libwget/html_url.c (html_get_url): Parse download attribute.
2020-03-15 11:53:09 +01:00
ddab633a5d
Add new function wget_strmemcpy_a
...
* include/wget/wget.h: Add prototype of wget_strmemcpy_a.
* src/mem.c: Implement wget_strmemcpy_a.
* libwget/http_parse.c (wget_http_parse_header_line): Use wget_strmemcpy_a.
* src/utils.c (mkdir_path): Likewise.
2020-02-24 16:31:01 +01:00
473a4da2bc
Let wget_strmemcpy return the number of copied bytes
...
* include/wget/wget.h: Set return type of wget_strmemcpy to size_t.
* libwget/mem.c (wget_strmemcpy): Return length of destination string.
* unit-tests/test.c: Amend tests of wget_strmemcpy.
2020-02-24 16:30:02 +01:00
91bba3f697
Add option --bind-interface
...
* libwget/net.h (wget_tcp_st): New variable
const char *bind_interface.
* libwget/net.c: Add function wget_tcp_bind_interface().
(set_socket_options): Add parameter wget_tcp *tcp and
implement binding of tcp to bind_interface.
* libwget/init.c (wget_global_init): Call wget_tcp_bind_interface().
* include/wget/wget.h: Add wget_tcp_bind_interface() and
WGET_BIND_INTERFACE.
* src/options.c: Add --bind-interface handling.
(init): Call wget_tcp_bind_interface().
* src/wget2_options.h (config): Add const char *bind_interface.
* docs/wget2.md: Add documentation for --bind-interface.
This finishes task #430
2020-02-24 12:28:00 +01:00
50c8e3a0f1
* include/wget/wget.h: Make more use of 'restrict' keyword
2020-02-10 11:55:46 +01:00
59d9ecd9c0
* Update copyright year to 2020
2020-01-10 00:33:02 +01:00
792c35b780
* include/wget/wget.h: Fix old types in comments [skip ci]
2019-12-08 18:29:18 +01:00
6d47c6b0db
Fix --cut-file-get-vars creating dirs on single file download
...
* tests/test-cut-get-vars.c: Amend to reproduce issue #490 .
* src/blacklist.c (get_local_filename_real): Generate basename
instead of filename, without query.
* include/wget/wget.h: Add flag WGET_IRI_WITH_QUERY.
Add param 'flags' to wget_iri_get_basename.
* libwget/iri.c: Add param 'flags' to wget_iri_get_basename.
Implement flag WGET_IRI_WITH_QUERY.
* fuzz/libwget_iri_fuzzer.c (test): Use WGET_IRI_WITH_QUERY.
Closes #490
2019-12-07 17:29:48 +01:00
f3e1d61a25
Rename wget_iri_get_filename -> wget_iri_get_basename
...
* fuzz/libwget_iri_fuzzer.c: Likewise.
* include/wget/wget.h: Likewise.
* libwget/iri.c: Likewise.
* src/blacklist.c: Likewise.
2019-12-07 15:40:53 +01:00
5c42026ee4
Add --ignore-length handling
...
* include/wget/wget.h (wget_http_request): Add bool
response_ignorelength
(wget_http_response): Add bool length_inconsistent
* src/options.c: Add --ignore-length handling
* src/wget_options.h (config): Add bool ignore_length
(exit_status_e): Add WGET_EXIT_INCONSISTENT_LENGTH
* libwget/http.c (wget_http_response_cb): Set length_inconsistent
when mismatch with Content-Length
* src/wget.c (wget_send_request): Set ignore-length in request
* tests/test-ignore-length.c: test --ignore-length
* tests/Makefile.am: add test-ignore-length
* docs/wget2.md: Removed [unimplemented-option] from
--ignore-length
2019-11-05 21:43:17 +05:30
003afe3b3b
* include/wget/wget.h (wget_bar_slot_begin): Set 'filename' not NONNULL
2019-10-29 23:44:57 +01:00
149a811543
Fix type of 2nd param of wget_stringmap_iterator_next() to void **
...
* include/wget/wget.h: Likewise
* unit-tests/test.c: Likewise
2019-10-26 18:48:33 +02:00
53e8b14764
Make metalink->iri 'const'
...
* include/wget/wget.h: Make metalink->iri 'const'
* libwget/metalink.c (add_mirror): Code cleanup
* src/wget.c (establish_connection): Skip HTTP mirrors if HTTPS requested,
(queue_url_from_local): Lock mutex a bit later
2019-10-26 18:48:33 +02:00
2ec7c7e290
Deduplicate code for creating robots.txt jobs
...
* src/wget.c (queue_url_from_local): Remove duplicated code,
(queue_url_from_remote): Likewise,
(set_file_metadata): Amend calling wget_iri_get_connection_part()
* include/wget/wget.h (wget_iri_parse_base): Add 'const' to 'base' param,
(wget_iri_get_connection_part): Add 'const' to 'iri' param,
add second param 'buf'
* fuzz/libwget_iri_fuzzer.c (test): Amend calling wget_iri_get_connection_part()
* libwget/iri.c (wget_iri_get_connection_part): Add param 'buf',
add 'const' to 'iri' param, amend docs,
(wget_iri_relative_to_abs): Add 'const' to 'base' param,
amend calling wget_iri_get_connection_part(),
(wget_iri_parse_base): Add 'const' to 'iri' param
* src/host.c (host_add_robotstxt_job): Add code removed in wget.c
* src/wget_host.h: Don't include wget_blacklist.h,
amend signature of host_add_robotstxt_job()
* src/wget_job.h (struct JOB): Add 'const' to 'blacklist_entry'
2019-10-26 18:48:33 +02:00
d930fe3bc1
Moved WGET_E_GPG_* definitions out of libwget
...
* libwget/error.c (wget_strerror): Remove WGET_E_GPG_* symbols
* include/wget/wget.h (wget_error): Remove WGET_E_GPG_* symbol definitions
* src/wget_gpgme.h: New enum wget_gpg_error to hold WGET_E_GPG_* symbol definitions
* AUHOTRS: Add archpndy [at] gmail.com
Copyright-paperwork-exempt: Yes
2019-10-21 18:33:55 +05:30
193efa7556
* include/wget/wget.h: Add WGET_GCC_UNUSED_RESULT to wget_hashmap_get and wget_stringmap_get
2019-10-10 15:27:13 +02:00
77c3c33ec8
Use int64_t for time_t to fix 32bit time_t limitations
...
* include/wget/wget.h: Use int64_t instead of time_t
* libwget/hpkp.c: Likewise
* libwget/hsts.c: Likewise
* libwget/http_parse.c: Likewise
* libwget/ocsp.c: Likewise
* libwget/ssl_gnutls.c: Likewise
* libwget/tls_session.c: Likewise
* src/options.c: Likewise
* src/stats_site.c: Likewise
* src/wget.c: Likewise
* tests/libtest.c: Likewise
* tests/libtest.h: Likewise
* tests/test-plugin-dummy.c: Likewise
* unit-tests/test.c: Likewise
2019-09-23 21:17:38 +02:00
803589baff
Fix http date functions to use int64_t instead of time_t
...
* include/wget/wget.h: Change time_t -> int64_t for wget_http_print_date()
and for wget_http_parse_full_date()
* libwget/http_parse.c: Likewise
2019-09-23 15:34:03 +02:00
9329563387
Modify wget_decompress() 2nd arg to const
...
* include/wget/wget.h: Likewise
* libwget/decompressor.c: Likewise
2019-09-21 19:35:06 +02:00
3bd8e6aa97
Implement Accept-Encoding: lzip including decompressor
...
* README.md: Mention lzip
* configure.ac: Detect lzip
* docs/wget2.md: Document 'lzip'
* include/wget/wget.h: Add wget_content_encoding_lzip
* libwget/decompressor.c: Implement lzip decompression
* libwget/http_parse.c (wget_http_parse_content_encoding): Add "lzip"
* src/options.c: Add code to support lzip
* src/wget.c (http_create_request): Add lzip to Accept-Encoding: if available
* tests/test-compression.c: Add test vector for lzip decompression
2019-09-19 12:58:09 +02:00
44f3411f73
Change type to bool for wget_tcp_set_ssl/wget_tcp_get_ssl
...
* include/wget/wget.h: Likewise
* libwget/net.c: Likewise
2019-09-18 13:16:18 +02:00
7e41468e17
Use '!= 0' instead of 'git commit --amend' in libwget/ssl_gnutls.c
...
* include/wget/wget.h (wget_tls_stats_data): Change type of tfo and false_start to bool
* libwget/ssl_gnutls.c: Use bool in _session_context,
remove use of !!
2019-09-18 13:12:16 +02:00
8d2acb05e4
Change return type of wget_tcp_get_tls_false_start() to bool
...
* include/wget/wget.h: Likewise
* libwget/net.c: Likewise
2019-09-18 13:07:16 +02:00
93245a5838
Change second param type of wget_tcp_set_tls_false_start() to bool
...
* include/wget/wget.h: Likewise
* libwget/net.c: Likewise
* src/wget_options.h (struct config): Change type of tls_false_start to bool
2019-09-18 13:05:50 +02:00
2013bd2168
Change return type of wget_tcp_get_tcp_fastopen() to bool
...
* include/wget/wget.h: Likewise
* libwget/net.c: Likewise
2019-09-18 13:02:46 +02:00
29d6777b57
Change second param type of wget_tcp_set_tcp_fastopen() to bool
...
* include/wget/wget.h: Likewise
* libwget/net.c: Likewise
* libwget/init.c (wget_global_init): Fix param type to wget_tcp_set_tcp_fastopen()
* src/wget_options.h (struct config): Change type of tcp_fastopen to bool
2019-09-18 12:59:43 +02:00
08d445e3f6
Use bool instead of char in HSTS code
...
* include/wget/wget.h: Change param to bool in wget_hsts_db_add_fn(),
(struct wget_http_response_st): Use bool for hsts_include_subdomains and keep_alive,
change param to bool in wget_http_parse_strict_transport_security(),
change param to bool in wget_http_parse_connection()
* libwget/hsts.c: change param to bool in new_hsts(),
change param to bool in wget_hsts_db_add()
* libwget/http_parse.c: change param to bool in wget_http_parse_strict_transport_security(),
change param to bool in wget_http_parse_connection()
* tests/test-plugin-dummy.c: change param to bool in test_hsts_db_add()
* unit-tests/test.c (test_hsts): Change type of include_subdomains to bool
2019-09-18 12:44:26 +02:00
b8a2a8274b
Change return type of wget_str_needs_encoding() to bool
...
* include/wget/wget.h: Likewise
* libwget/encoding.c: Likewise
2019-09-18 12:29:35 +02:00
5b32f680ee
Use bool param for wget_cookie_set_keep_session_cookies()
...
* include/wget/wget.h: Change second param of wget_cookie_set_keep_session_cookies() to bool
* libwget/cookie.c: Likewise
* libwget/init.c (struct _CONFIG): Use bool for cookies_enabled, keep_session_cookies
2019-09-18 12:23:47 +02:00
4b9edbad2d
Update Copyright statements to be compatible with update-copyright module
2019-09-10 23:41:56 +02:00
3ce5137d5b
Rename wget_html_parsed_url.dir -> wget_html_parsed_url.tag
...
* include/wget/wget.h: Rename wget_html_parsed_url.dir -> wget_html_parsed_url.tag
* examples/print_html_urls.c: Likewise
* libwget/html_url.c: Likewise
* src/wget.c: Likewise
2019-09-02 17:37:32 +02:00
ad037396ce
Only use clang's Nullability feature with enabled manywarnings
2019-08-30 12:18:58 +02:00
4c3945641a
Fix hashing with WolfTLS backend
...
* include/wget/wget.h: Change param for wget_hash_init(),
change param and return type for wget_hash_deinit()
* libwget/hashfile.c: Rewrite hashing functions for WITH_LIBWOLFCRYPT
* unit-tests/test.c: Add tests for incremental hashing
2019-08-29 22:36:35 +02:00
e4bcb5eab6
Add more hash backends
2019-08-29 22:36:35 +02:00
c936c5df83
* include/wget/wget.h: Fix typos
2019-08-23 14:48:33 +02:00
54c32f5627
Cleanup + amend return vales of buffer functions
...
* include/wget/wget.h: Add wget_buffer.error
* libwget/buffer.c: Amend docs,
change return type of wget_buffer_init(),
amend wget_buffer_alloc(),
set buf.error in _buffer_realloc()
* libwget/printf.c: Check buf.error, return (size_t)-1
* unit-tests/test.c: Amend tests appropriately
2019-08-21 21:46:20 +02:00
76bc9ecb93
Introduce WGET_E_IO
...
* include/wget/wget.h: Introduce WGET_E_IO
* libwget/error.c: Add WGET_E_IO to wget_strerror()
* libwget/hashfile.c: Make use of WGET_E_IO
* libwget/io.c: Likewise
2019-08-17 18:32:14 +02:00
d663bd124a
Rename WGET_E_OPEN_FILE -> WGET_E_OPEN
...
* include/wget/wget.h: Rename WGET_E_OPEN_FILE -> WGET_E_OPEN
* libwget/io.c: Likewise
* libwget/netrc.c: Likewise
2019-08-17 18:15:26 +02:00
188b6a5ba7
Cleanup vector functions and docs
2019-08-17 17:42:40 +02:00
ee149aaff1
* include/wget/wget.h: Add NULLABLE to more functions
2019-08-17 17:42:40 +02:00
5e24587fb0
* include/wget/wget.h: Nullable wget_memdup, wget_strdup, wget_strmemdup
2019-08-16 17:21:20 +02:00
c3075a1e21
Introduce nullability support for clang's static analyzer
...
* configure.ac: Add -Wno-nullability-extension -Wno-nullability-completeness to WARN_CFLAGS
* include/wget/wget.h: Add CLANG_VERSION_AT_LEAST,
fix attribute defines for clang,
make use of attributes by using static inline functions for wget allocation,
define NULLABLE for clang
* libwget/xalloc.c: Rename wget allocation function pointers
* src/options.c: Likewise
* unit-tests/test.c: Likewise
2019-08-16 15:24:19 +02:00
3ff510ea7f
* include/wget/wget.h: Define WGET_GCC_RETURNS_NONNULL for clang as well
2019-08-15 13:25:15 +02:00
bdc2d0e3ce
Add new error code WGET_E_OPEN_FILE
2019-08-15 11:01:04 +02:00
aa60e2333f
Change return type of wget_hpkp_get_n_pins() to int
...
* include/wget/wget.h: Change return type of wget_hpkp_get_n_pins() to int
* libwget/hpkp.c: Likewise
* unit-tests/test.c: Adjust code, cleanup
2019-08-13 16:55:59 +02:00