Commit Graph

38 Commits

Author SHA1 Message Date
f64a41ac14 Add wget_strscpy()
* include/wget/wget.h: Add wget_strscpy()
* libwget/strscpy.c: New file
* libwget/Makefile.am: Add strscpy.c
* libwget/html_url.c: Use wget_strscpy() instead of wget_strlcpy()
* libwget/http.c: Likewise
* libwget/iri.c: Likewise
* libwget/metalink.c: Likewise
* libwget/ssl_gnutls.c: Likewise
* libwget/test_linking.c: Likewise
* src/job.c: Likewise
* src/plugin.c: Likewise
* src/wget.c: Likewise
2017-10-13 10:57:55 +02:00
6a167ca2c4 Correctly include config.h into css_tokenizer
* libwget/css_tokenizer.lex: Add config.h via %top directive
* libwget/Makefile.am: Remove sed from make target
2017-06-24 12:16:07 +02:00
3b7f266803 Enhance creating of libwget/css_tokenizer.c
* Makefile.am: Remove '<stdout>' special handling in coverage rules
* libwget/Makefile.am: Generate css_tokenizer.c with proper automake
  macros, prepend include line using sed.
2017-06-22 11:24:47 +02:00
16da098e9c Move parsing from libwget/http.c to libwget/http_parse.c
* libwget/Makefile.am: Add http_parse.c
* libwget/http.c: Remove parse functions
* libwget/http_parse.c: New file with parse functions
2017-06-18 20:36:46 +02:00
4d3b3f5167 Add basic plugin loading mechanism
* configure.ac: Add configure time tests for plugin support backend.
* include/wget/wget.h: Add basic plugin API
* libwget/Makefile.am: Add new file plugin.c to libwget.la
* libwget/plugin.c: Add plugin API functions (new file)
* src/Makefile.am: Add new files dl.c, wget_dl.h, plugin.c, wget_plugin.h
                   to wget2
* src/dl.c: Add abstraction for dynamic loading of object files
* src/wget_dl.h: Likewise
* src/plugin.c: Add implementation for loading plugins
* src/wget_plugin.h: likewise
* src/options.c: Add options `--plugin=`, `--local-plugin=`,
                 `--plugin-dirs=`, `--list-plugins`
* src/wget.c: Add function calls to initialize and finalize plugin
              support system
* unit-tests/Makefile.am: Add test-dl, libalpha.la, and libbeta.la
* unit-tests/test-dl.c: Add unit test for src/dl.c
* unit-tests/test-dl-dummy.c: Likewise
* tests/Makefile.am: Add test-plugin, libpluginname.la, and
                     libpluginexit.la
* tests/test-plugin.c: Add tests for plugin support
* tests/test-plugin-dummy.c: Likewise
* libwget/test-linking.c: Fix warnings with --enable-manywarnings
* unit-tests/test.c: likewise

Plugin loading mechanism has been implemented as per specifications
at https://gitlab.com/akash_rawal/wget2/wikis/Stage-0
2017-06-06 17:04:44 +02:00
cbc802efbe * libwget/Makefile.am: Fix CPPFLAGS for libcsstokenizer 2017-05-24 18:35:38 +02:00
70d124a8b8 * libwget/Makefile.am: Remove macro warnings 2017-05-24 14:50:22 +02:00
c7882ca0c0 * libwget/Makefile.am: Use convenience library to avoid unused macro warnings 2017-05-15 12:06:30 +02:00
e0b3dc1d26 Make wget_http_connection_t an abstract type
* include/wget/wget.h: Convert wget_http_connection_t to forward declaration
 * libwget/http.h: Move wget_http_connection_t definition here
 * libwget/Makefile.am: Add new file http.h
 * libwget/http.c: Include http.h and add accessor functions
 * libwget/http_highlevel.c: Include http.h
 * src/wget.c: Replace access to wget_http_connection_t with accessor function calls
2017-05-03 15:37:50 +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
57b259e868 HPKP boilerplate
* libwget/Makefile.am: new file hpkp.c.
 * src/options.c (print_help, struct options): new command line option '--hpkp'.
   (init): initialize HPKP database with wget_hpkp_db_init().
 * src/wget_options.h (struct config): new handle 'hpkp' to the HPKP
   database.
2017-02-22 12:46:01 +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
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
9dd781756b * libwget/Makefile.am: Add more libs to LDADD 2017-01-06 10:29:10 +01:00
58d18ad60c New function to check for literal IPv4/IPv6 addresses
* bootstrap.conf: Add gnulib module 'inet_pton'
* docs/Makefile.am: Add man page libwget-ip.3
* wget/wget.h (struct wget_iri_st): New field 'is_ip_address'.
* libwget/Makefile.am: Add new file ip.c
* libwget/ip.c: New file defining new function wget_ip_is_family()
* libwget/iri.c (wget_iri_parse): Check for literal IP address
* src/wget.c: Do not add to HSTS if literal IP address
2016-11-08 16:22:08 +01:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
2bc25879cf Add TLS Session Resumption with persistent cache
* include/libwget.h.in: Add wget_tls_session_* set of functions,
  add new define WGET_SSL_SESSION_CACHE
* libwget/Makefile.am: Add tls_session.c to libwget
* libwget/ssl_gnutls.c (struct _config): Add tls_session_cache.
  (struct _session_context): Add delayed_session_data.
  (wget_ssl_set_config_string): Handle WGET_SSL_SESSION_CACHE.
  (wget_ssl_open): Add False Start debug messages,
  Set session data if cound in cache,
  Write session data into cache.
  (wget_ssl_read_timeout): Write session data into cache when
    False Start has been activated.
* libwget/tls_session.c: New file with session data cache implementation
* src/options.c (print_help): Add new options --tls-resume and
  --tls-session-file.
  (config): Set tls_resume activated by default.
  (options[]): Add tls-resume and tls-session-file.
  (init): Create session file name, init session data cache,
  Set session cache for TLS layer.
  (deinit): Free session cache and session cache filename.
* src/options.h (struct config): Add tls_session_db, tls_session_file,
  tls_resume.
* src/wget.c (main): Save session cache if changed.

TLS Session Resumption speeds up TLS handshake by 1xRTT.
Together with TCP Fast Open (enabled by default), we are down at
1xRTT TLS handshake overhead. To get down to 0 RTT we need a different
TLS protocol - TLS v1.3 will hopefully soon be standardized.
2016-07-22 10:43:59 +02:00
a8d99227e8 Add gnulib module 'manywarnings'
* autogen.sh: Add module manywarnings
* configure.ac: Add ./configure option --enable-gcc-warnings to enable
 many warnings
* examples/Makefile.am: Add WERROR_CFLAGS and WARN_CFLAGS to AM_CFLAGS
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
2016-06-14 12:22:03 +02:00
4aedab2d6d Adjust LDFLAGS for MinGW
* examples/Makefile.am: Add -no-install to AM_LDFLAGS
* libwget/Makefile.am: Add -no-undefined to libwget_la_LDFLAGS
2016-05-08 23:06:58 +02:00
dceefed652 Renamed libwget/compat.c -> libwget/strlcpy.c 2016-04-03 10:48:19 +02:00
fb840427d2 Add $(LIB_PTHREAD) to makefiles
* examples/Makefile.am, libwget/Makefile.am, src/Makefile.am,
  tests/Makefile.am: Add $(LIB_PTHREAD)
2016-01-23 22:51:43 +01:00
826e5ac601 Add thread-safe wrapper code around random() and srandom()
* docs/Makefile.am: Add wget_random and wget_srandom to docs
* include/libwget.h.in: Add wget_random and wget_srandom
* libwget/Makefile.am: Add random.c
* libwget/http.c: Use wget_random()
* libwget/random.c: New file with wget_random and wget_srandom
* src/options.c: Remove call to srandom()
2016-01-22 20:50:12 +01:00
f99b4bb8fa Fix libwget/Makefilea. for Solaris
* libwget:/Makefile.am: Add ../lib/libgnu.la to test_linking_LDADD
2016-01-15 14:44:35 +01:00
ca28fbc905 Include config.h on top in css_tokenizer.c
* libwget/Makefile.am: Add #include "config.h" to top of css_tokenizer.c

Found this issue on OpenSolaris
2016-01-15 12:21:23 +01:00
7250e6ccb9 Add symbol visibility control to libwget
* autogen.sh: Add gnulib module lib-symbol-visibility,
  add --libtool to gnulib-tool invokation
* examples/Makefile.am: Remove -static from AM_LDFLAGS,
  remove ../lib/libgnu.a from LDADD
* include/libwget.h.in: Define LIBWGET_EXPORT,
  add LIBWGET_EXPORT to all visible symbols
* libwget/Makefile.am: Remove AM_CPPFLAGS and LDADD,
  add libwget_la_CPPFLAGS and libwget_la_LIBADD,
  add test_linking_CPPFLAGS, fix test_linking_LDADD
* libwget/iri.c: Add LIBWGET_EXPORT to wget_iri_schemes and iri_ports
* src/Makefile.am: Remove wget2_LDFLAGS, fix wget2_LDADD
* tests/Makefile.am: Fix LDADD, fix test_LDADD, fix test_parse_html_LDADD,
  fix libtest_la_CPPFLAGS and libtest_la_LIBADD
* tests/libtest.h: Add LIBWGET_EXPORT to symbols
2016-01-15 11:21:35 +01:00
31f0fc0190 Added printf-style functions
* libwget/printf.c: New file
* docs/libwget/Makefile.am: Add libwget-printf.3
* docs/libwget/libwget-docs.sgml: Add printf section
* docs/libwget/libwget-sections.txt: Add SECTION libwget-printf
* include/libwget.h.in: Add function prototypes
* libwget/Makefile.am: Add printf.c
* libwget/base64.c, libwget/http.c, libwget/iri.c, libwget/logger.c,
  libwget/md5.c, libwget/vector.c, src/options.c:
  Use new functions instead of asprintf/vasprintf
2016-01-13 13:33:51 +01:00
69d1b3392c Add gnulib module setlocale
* autogen.sh: Add gnulib module setlocale
* configure.ac: Remove searching for setlocale, locale.h, sys/time.h
* src/wget.c: Move #include <locale.h> (cosmetics)
* examples/Makefile.am: Add $(LIBTHREAD), @INTL_MACOSX_LIBS@ to LDADD
* libwget/Makefile.am: Add to $(LTLIBTHREAD), @INTL_MACOSX_LIBS@ LDADD
* src/Makefile.am: Add $(LIBTHREAD), @INTL_MACOSX_LIBS@ to LDADD
* tests/Makefile.am: Add $(LIBTHREAD), @INTL_MACOSX_LIBS@ to LDADD
2016-01-12 17:08:29 +01:00
c6e0ba1dce Add gnulib module iconv
* autogen.sh: Add gnulib module iconv
* configure.ac: Remove AM_ICONV
* examples/Makefile.am: Add $(LIBICONV) to LDADD
* libwget/Makefile.am: Add $(LIBICONV) to LDADD
* src/Makefile.am: Add $(LIBICONV) to LDADD
* tests/Makefile.am: Add $(LIBICONV) to LDADD
2016-01-12 15:58:40 +01:00
dd9cb25fcc Cover network functions with gnulib modules
* autogen.sh: Add accept, bind, close, connect, getaddrinfo, getsockname,
  listen, netdb, netinet_in, open, read, send, sendto, servent, setsockopt,
  socket, sys_socket, write to modules
* configure.ac: Remove searching for ws2_32, libsocket, libnsl, netdb.h,
  netinet/in.h, sys/socket.h, socket.
  Add searching for netinet/tcp.h.
* examples/Makefile.am: Add additional libs.
* libwget/Makefile.am: Add additional libs.
* src/Makefile.am: Add additional libs.
* tests/Makefile.am: Add additional libs.
* libwget/http.c: Remove conditional code.
* libwget/net.c: Remove conditional code. Use c_isdgit().
* libwget/net.h: Remove conditional code.
2016-01-12 15:08:14 +01:00
fe025a60c9 Add compatibility to older flex versions
* libwget/Makefile.am: Remove space between -o and filename
2016-01-12 11:24:33 +01:00
e8fafdeb9f Add header file gnulib modules
* autogen.sh: Add gettext-h, inttypes, stdarg, stddef, stdint
* configure.ac: Remove check for inttypes.h, libintl.h, stddef.h
  Remove AC_TYPE_* checks
* include/libwget.h.in: Include gnulib gettext.h
* examples/Makefile.am: Fix AM_CPPFLAGS, add $(LIBINTL) to LDADD
* libwget/Makefile.am: Fix LDADD and test_linking_LDADD
* src/Makefile.am: Add $(LIBINTL) to wget2_LDADD
* tests/Makefile.am: Fix AM_CPPFLAGS and libtest_la_CPPFLAGS,
  add $(LIBINTL) to LDADD, test_LDADD and test_parse_html_LDADD
2016-01-12 10:18:09 +01:00
a2e486f2b6 Remove libwget/printf.c
* configure.ac: Remove check for dprintf
* include/libwget.h.in: Remove dprintf/vdprintf prototypes
* libwget/Makefile.am: Remove printf.c from file list
* libwget/printf.c: Remove file
2016-01-11 13:30:56 +01:00
8a9d2cf348 Link with libgnu.a
* libwget/Makefile.am: Add lib/ to AM_CPPFLAGS, add libgnu.a to *_LDADD
* src/Makefile.am: Same
* tests/Makefile.am: Same, rename object files to link with tests
2016-01-09 19:34:29 +01:00
ad691f1f3f Remove API version from library file names
* .gitignore, Makefile.am, configure.ac, examples/Makefile.am,
  libwget.pc.in, libwget/Makefile.am, src/Makefile.am, tests/Makefile.am:
  Remove API version from library file names
2016-01-09 17:56:32 +01:00
e3b89db8c7 Hook gnulib into project 2016-01-09 16:04:25 +01:00
1cbb8ae9f7 Rename LIBWGET_API_VERSION to LIBWGET_VERSION 2016-01-06 16:25:27 +01:00
bbcb319ac3 Add new options --netrc and --netrc-file
* libwget/netrc.c: New file for netrc API functions
* include/libwget.h: Add netrc function prototypes
* libwget/Makefile.am: Add netrc.c
* libwget/test_linking.c (main): Add call to wget_netrc_deinit()
* src/options.c: Add --netrc and --netrc-file
* src/options.h: Add config.netrc and config.netrc_file
* src/wget.c (http_get): Get login/password from netrc data
* tests/test-auth-basic.c (main): Add test for --netrc-file
2015-11-11 20:58:45 +01:00
c6b0e461a1 Transform Mget into Wget 2015-09-19 22:54:38 +02:00