1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00
Commit Graph

132 Commits

Author SHA1 Message Date
Darshit Shah
4ed540ddc7 Eliminate NDEBUG redefined warnings
* src/wget.h: Define NDEBUG only if it hasn't been defined before
2015-11-16 23:53:59 +01:00
Ander Juaristi
f8901af4e0 Added support for FTPS
* doc/wget.texi: updated documentation to reflect the new FTPS functionality.
 * src/ftp-basic.c (ftp_greeting): new function to read the server's greeting.
   (ftp_login): greeting code was previously here. Moved to ftp_greeting to
   support FTPS implicit mode.
   (ftp_auth): wrapper around the AUTH TLS command.
   (ftp_ccc): wrapper around the CCC command.
   (ftp_pbsz): wrapper around the PBSZ command.
   (ftp_prot): wraooer around the PROT command.
 * src/ftp.c (get_ftp_greeting): new static function.
   (init_control_ssl_connection): new static function to start SSL/TLS on the
   control channel.
   (getftp): added hooks to support FTPS commands (RFCs 2228 and 4217).
   (ftp_loop_internal): test for new FTPS error codes.
 * src/ftp.h: new enum 'prot_level' with available FTPS protection levels +
   prototypes of previous functions. New flag for enum 'wget_ftp_fstatus' to track
   whether the data channel has some security mechanism enabled or not.
 * src/gnutls.c (struct wgnutls_transport_context): new field 'session_data'.
   (wgnutls_close): free GnuTLS session data before exiting.
   (ssl_connect_wget): save/resume SSL/TLS session.
 * src/http.c (establish_connection): refactor ssl_connect_wget call.
   (metalink_from_http): take into account SCHEME_FTPS as well.
 * src/init.c, src/main.c, src/options.h: new command line/wgetrc options.
   (main): in recursive downloads, check for SCHEME_FTPS as well.
 * src/openssl.c (struct openssl_transport_context): new field 'sess'.
   (ssl_connect_wget): save/resume SSL/TLS session.
 * src/retr.c (retrieve_url): check new scheme SCHEME_FTPS.
 * src/ssl.h (ssl_connect_wget): refactor. New parameter of type 'int *'.
 * src/url.c. src/url.h: new scheme SCHEME_FTPS.
 * src/wget.h: new FTPS error codes.
 * src/metalink.h: support FTPS scheme.
2015-09-14 10:16:44 +02:00
Tim Rühsen
5d55018ce6 void uninitialized variable in metalink code
* src/metalink.c: Init retr_err with METALINK_MISSING_RESOURCE
* src/wget.h: Add enum METALINK_MISSING_RESOURCE
2015-08-04 17:24:59 +02:00
Ander Juaristi
b60131a399 Added support for HSTS.
* Makefile.am: Added new source files hsts.c and hsts.h.
 * http.c (parse_strict_transport_security): new function for STS header
   parsing.
   (gethttp): update the HSTS store.
 * http.h: new include "hsts.h".
 * init.c: new options --hsts and --hsts-file.
 * main.c (get_hsts_database, load_hsts, save_hsts): new functions.
   New options --no-hsts and --hsts-file added to help.
   (main): load and save HSTS store.
 * options.h: new variables for supporting --hsts and --hsts-file.
 * retr.c (retrieve_url): rewrite the URI according to the HSTS policy before
   entering http_loop.
 * test.c, test.h: new unit tests for HSTS.
 * utils.c, utils.h (countchars): new function.
 * wget.h: new preprocessor check.
 * hsts.c, hsts.h: new files with the HSTS engine implementation.

Added support for HTTP Strict Transport Security (HSTS), as defined by RFC
6797.
2015-07-20 15:55:57 +02:00
Hubert Tarasiuk
37b58e3976 Metalink support.
* bootstrap.conf: Add crypto/sha256
* configure.ac: Look for libmetalink and GPGME
* doc/wget.texi: Add --input-metalink and --metalink-over-http
options description.
* po/POTFILES.in: Add metalink.c
* src/Makefile.am: Add new translation unit (metalink.c)
* src/http.c (http_stat): Add metalink field.
(free_stat): Free metalink field.
(find_key_value): Find value of given key in header string.
(has_key): Check if token exists in header string.
(find_key_values): Find all key=value pairs in header string.
(metalink_from_http): Obtain Metalink metadata from HTTP response.
(gethttp): Call metalink_from_http if requested.
(http_loop): Request Metalink metadata from HTTP response if should be.
Fall back to regular download if no Metalink metadata found.
* src/init.c: Add --input-metalink and --metalink-over-http options
* src/main.c (option_data): Handle --input-metalink and
--metalink-over-http cmd arguments.
(print_help): Print --input-metalink option description.
(main): Retrieve files from Metalink file
* src/metalink.c (retrieve_from_metalink): Download files described by
metalink.
(metalink_res_cmp): Comparator for resources priority-sorting.
* src/metalink.h: Create header for metalink.c
(RES_TYPE_SUPPORTED): Define supported resources media.
(DEFAULT_PRI): Default mirror priority for Metalink over HTTP.
(VALID_PRI_RANGE): Valid priority range.
* src/options.h (options): Add input_metalink option and metalink_over_http
options.
* src/utils.c (hex_to_string): Convert binary data to ASCII-hex.
* src/utils.h (hex_to_string): Add prototype.
* src/wget.h: Add metalink-related error enums
Add METALINK_METADATA flag for document type.
2015-07-20 15:30:39 +02:00
Hubert Tarasiuk
8a8d138dcc Support If-Modified-Since header in timestamping mode.
* src/wget.h: Add IF_MODIFIED_SINCE enum for dt. Add TIMECONV_ERR
enum to uerr_t.
* src/http.c (time_to_rfc1123): Convert time_t do http time.
* src/http.c (initialize_request): Include If-Modified-Since header
if appropriate.
* src/http.c (set_file_timestamp): Separate this code from check_file_output.
* src/http.c (check_file_output): Use set_file_timestamp.
* src/http.c (gethttp): Handle properly 304 return code and 200 if server
ignores If-Modified-Since headers.
* src/http.c (http_loop): Load filename to hstat if condget was requested,
use IF_MODIFIED_SINCE if requested and current timestamp can be obtained.
2015-05-22 11:08:30 +02:00
Giuseppe Scrivano
16f1fb1d1f maint: update copyright year ranges to include 2015 2015-03-09 16:32:01 +01:00
Tim Rühsen
3d8e765c1d gettext: Use gnulib's gettext.h for compatibility
Fixes issues with gettext on Solaris
Reported-by: Kiyoshi KANAZAWA <yoi_no_myoujou@yahoo.co.jp>
2015-02-10 09:56:32 +01:00
Darshit Shah
4b845615fa Define MIN and MAx macros in a single location
MIN and MAx are macros that a developer will universally expect
throughout the source. Yet, they were being defined in multiple places
across the source. Instead, define them in a single location in the
common wget.h header file and use them consistently everywhere.
2014-12-04 18:36:54 +05:30
Tim Rühsen
e194c1dfd3 Get rid of gettext.h 2014-11-28 11:27:58 +01:00
Tim Rühsen
9217b864d8 Make program_name and program_argstring const 2014-11-24 10:20:51 +01:00
Darshit Shah
1b8e54b808 Add extern declaration for program_arsgstring
In test.c, this patch changes the type of program_argstring to char *
from a const char *. This is because, we use a char * string in the rest
of the program and declare an extern accordingly. Removing the const
type helps in keeping the code cleaner at no extra cost.
2014-11-22 17:26:06 +05:30
Darshit Shah
eab0f5d222 Make extern declaration for program_name 2014-11-22 17:26:06 +05:30
Tim Rühsen
3c51ad7f02 Removed form feeds from sources and NEWS 2014-11-20 16:35:34 +01:00
Tim Rühsen
7b43510fe3 Fixes possible issues with Wget running in a turkish locale 2014-11-20 10:56:21 +01:00
Darshit Shah
c6ee033425 Make 504 Gateway Timeout non fatal 2014-11-19 18:03:17 +05:30
Darshit Shah
97ce41b2d0 Remove unused error codes 2014-07-05 16:18:31 +05:30
Giuseppe Scrivano
ffccc7d3be Do not depend on always defined macros 2014-06-12 18:49:15 +02:00
Giuseppe Scrivano
a22cd7394b Remove trailing whitespaces 2014-06-12 18:49:14 +02:00
Darshit Shah
8624553a31 Whitespace and formatting changes.(Aesthetic only)
This commit makes lots of whitespace only changes. It has been ensured that this
commit does not make any changes to the functioning of the program. The only
changes that have been made are:
    * Remove trailing whitespaces
    * Convert tabs to spaces
    * Fix indentation issues in the code
    * Other aesthetic changes to the formatting of comments
2014-05-30 21:12:57 +05:30
Darshit Shah
92035dbabd Fix erroneous error codes when HTTP Digest Authentication fails. 2013-07-22 19:31:07 +02:00
Giuseppe Scrivano
3ebbd84518 warc: remove a magic number 2012-11-26 22:50:06 +01:00
Giuseppe Scrivano
ae0598df9b Check for fclose errors. 2012-06-17 22:24:32 +02:00
Gijs van Tulder
e3820953b2 Add support for WARC files. 2011-11-04 22:25:00 +01:00
Giuseppe Scrivano
8d764f3ac6 Use correctly FIONBIO values. 2011-04-17 13:07:01 +02:00
Filipe Brandenburger
e219e587b3 Support HTTP/1.1 307 redirects keep request method. 2011-03-03 14:02:25 +01:00
Giuseppe Scrivano
2f6aa1d741 mass change: update copyright years. 2011-01-01 13:19:37 +01:00
Merinov Nikolay
b5c9573ad6 Add --unlink. 2010-09-29 13:34:09 +02:00
Giuseppe Scrivano
293008f682 Mass update copyright years. 2010-05-08 21:56:15 +02:00
Micah Cowan
663b1b3367 imported patch windows 2009-09-22 18:43:02 -07:00
Micah Cowan
4a08094db8 [mq]: cfg-mk 2009-09-21 20:39:44 -07:00
Micah Cowan
b9e9ad65cc Ran update-copyright. 2009-09-04 00:13:47 -07:00
Micah Cowan
b014f8fae9 Improved exit status handling. 2009-08-27 23:08:58 -07:00
Micah Cowan
d5e283b1a7 Automated merge. 2009-07-04 15:32:57 -07:00
Saint Xavier
d82f80ecab Change global variable model for state-object 2008-07-24 00:56:29 +02:00
Micah Cowan
2e2ac6ad2f Merge current tip with CSS stuff. 2008-07-11 16:30:51 -07:00
Steven Schubiger
a52fa6056b Include Gnulib quotearg header. 2008-04-25 21:18:07 +02:00
Micah Cowan
714ccdcd84 Steven Schweda's VMS patch. 2008-04-22 14:48:36 -07:00
Micah Cowan
caae3b70f4 Merging Ted Mielczarek's CSS changes with tip. 2008-04-22 01:28:15 -07:00
Micah Cowan
a0d0f332d5 Ted Mielczarek's CSS wonder-patch, applied against the source from around the time the patch was written. 2008-04-22 00:15:48 -07:00
Steven Schubiger
2c77220411 Undo the USE_GNULIB_ALLOC defines. 2008-04-20 11:46:52 +02:00
Steven Schubiger
34747d72eb Conditional inclusion of Gnulib alloc headers. 2008-04-18 21:42:02 +02:00
Steven Schubiger
d9131151af Revert the alloca_array() -> xcalloc() transition. 2008-04-18 20:11:06 +02:00
Steven Schubiger
8aefedc7da Use Gnulib's xalloc module in convert.c (and include according header). 2008-04-17 00:35:34 +02:00
Micah Cowan
92956183a7 Applied Steven Schubiger's patch to use Gnulib's quote function in http.c. 2008-04-14 15:45:40 -07:00
Micah Cowan
e95867e6cc Deal with progress bars in environs lacking mbtowc or wcwidth. 2008-02-06 18:10:24 -08:00
Micah Cowan
bc8f473272 Updated copyright year. 2008-01-25 05:04:01 -08:00
Micah Cowan
462e643a7e Merge SFLC licensing changes for OpenSSL with tip. 2007-12-07 17:37:07 -08:00
Micah Cowan
86395b297b Updated licensing exception for OpenSSL from the SFLC. 2007-11-28 00:05:33 -08:00
Micah Cowan
212396c7e1 Eschew config-post.h. 2007-10-18 20:50:40 -07:00