mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
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
This commit is contained in:
parent
4eeabffee6
commit
8624553a31
@ -1,3 +1,10 @@
|
|||||||
|
2014-05-30 Darshit Shah <darnir@gmail.com>
|
||||||
|
|
||||||
|
* connect.{c,h}, convert.{c,h}, cookies.{c,h}, ftp-ls.c, ftp.h, gettext.h,
|
||||||
|
hash.h, host.h, html-parse.h, html-url.h, http.c, init.c, main.c, mswindows.c,
|
||||||
|
netrc.h, openssl.c, options.h, ptimer.h, recur.c, retr.c, sysdep.h, url.h,
|
||||||
|
vms.c, warc.c, wget.h: Whitespace and formatting changes only.
|
||||||
|
|
||||||
2014-05-20 Darshit Shah <darnir@gmail.com>
|
2014-05-20 Darshit Shah <darnir@gmail.com>
|
||||||
|
|
||||||
* utils.c (human_readable): Add new parameters, acc and decimals for the
|
* utils.c (human_readable): Add new parameters, acc and decimals for the
|
||||||
|
@ -273,7 +273,7 @@ connect_to_ip (const ip_address *ip, int port, const char *print)
|
|||||||
const char *txt_addr = print_address (ip);
|
const char *txt_addr = print_address (ip);
|
||||||
if (0 != strcmp (print, txt_addr))
|
if (0 != strcmp (print, txt_addr))
|
||||||
{
|
{
|
||||||
char *str = NULL, *name;
|
char *str = NULL, *name;
|
||||||
|
|
||||||
if (opt.enable_iri && (name = idn_decode ((char *) print)) != NULL)
|
if (opt.enable_iri && (name = idn_decode ((char *) print)) != NULL)
|
||||||
{
|
{
|
||||||
@ -287,18 +287,18 @@ connect_to_ip (const ip_address *ip, int port, const char *print)
|
|||||||
logprintf (LOG_VERBOSE, _("Connecting to %s|%s|:%d... "),
|
logprintf (LOG_VERBOSE, _("Connecting to %s|%s|:%d... "),
|
||||||
str ? str : escnonprint_uri (print), txt_addr, port);
|
str ? str : escnonprint_uri (print), txt_addr, port);
|
||||||
|
|
||||||
if (str)
|
if (str)
|
||||||
xfree (str);
|
xfree (str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ip->family == AF_INET)
|
if (ip->family == AF_INET)
|
||||||
logprintf (LOG_VERBOSE, _("Connecting to %s:%d... "), txt_addr, port);
|
logprintf (LOG_VERBOSE, _("Connecting to %s:%d... "), txt_addr, port);
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
else if (ip->family == AF_INET6)
|
else if (ip->family == AF_INET6)
|
||||||
logprintf (LOG_VERBOSE, _("Connecting to [%s]:%d... "), txt_addr, port);
|
logprintf (LOG_VERBOSE, _("Connecting to [%s]:%d... "), txt_addr, port);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store the sockaddr info to SA. */
|
/* Store the sockaddr info to SA. */
|
||||||
|
@ -32,7 +32,7 @@ as that of the covered work. */
|
|||||||
#ifndef CONNECT_H
|
#ifndef CONNECT_H
|
||||||
#define CONNECT_H
|
#define CONNECT_H
|
||||||
|
|
||||||
#include "host.h" /* for definition of ip_address */
|
#include "host.h" /* for definition of ip_address */
|
||||||
|
|
||||||
/* Function declarations */
|
/* Function declarations */
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ convert_links_in_hashtable (struct hash_table *downloaded_set,
|
|||||||
|
|
||||||
u = url_parse (cur_url->url->url, NULL, pi, true);
|
u = url_parse (cur_url->url->url, NULL, pi, true);
|
||||||
if (!u)
|
if (!u)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
local_name = hash_table_get (dl_url_file_map, u->url);
|
local_name = hash_table_get (dl_url_file_map, u->url);
|
||||||
|
|
||||||
|
@ -31,18 +31,18 @@ as that of the covered work. */
|
|||||||
#ifndef CONVERT_H
|
#ifndef CONVERT_H
|
||||||
#define CONVERT_H
|
#define CONVERT_H
|
||||||
|
|
||||||
struct hash_table; /* forward decl */
|
struct hash_table; /* forward decl */
|
||||||
extern struct hash_table *dl_url_file_map;
|
extern struct hash_table *dl_url_file_map;
|
||||||
extern struct hash_table *downloaded_html_set;
|
extern struct hash_table *downloaded_html_set;
|
||||||
extern struct hash_table *downloaded_css_set;
|
extern struct hash_table *downloaded_css_set;
|
||||||
|
|
||||||
enum convert_options {
|
enum convert_options {
|
||||||
CO_NOCONVERT = 0, /* don't convert this URL */
|
CO_NOCONVERT = 0, /* don't convert this URL */
|
||||||
CO_CONVERT_TO_RELATIVE, /* convert to relative, e.g. to
|
CO_CONVERT_TO_RELATIVE, /* convert to relative, e.g. to
|
||||||
"../../otherdir/foo.gif" */
|
"../../otherdir/foo.gif" */
|
||||||
CO_CONVERT_TO_COMPLETE, /* convert to absolute, e.g. to
|
CO_CONVERT_TO_COMPLETE, /* convert to absolute, e.g. to
|
||||||
"http://orighost/somedir/bar.jpg". */
|
"http://orighost/somedir/bar.jpg". */
|
||||||
CO_NULLIFY_BASE /* change to empty string. */
|
CO_NULLIFY_BASE /* change to empty string. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct url;
|
struct url;
|
||||||
@ -51,36 +51,36 @@ struct url;
|
|||||||
position in an HTML document, etc. */
|
position in an HTML document, etc. */
|
||||||
|
|
||||||
struct urlpos {
|
struct urlpos {
|
||||||
struct url *url; /* the URL of the link, after it has
|
struct url *url; /* the URL of the link, after it has
|
||||||
been merged with the base */
|
been merged with the base */
|
||||||
char *local_name; /* local file to which it was saved
|
char *local_name; /* local file to which it was saved
|
||||||
(used by convert_links) */
|
(used by convert_links) */
|
||||||
|
|
||||||
/* reserved for special links such as <base href="..."> which are
|
/* reserved for special links such as <base href="..."> which are
|
||||||
used when converting links, but ignored when downloading. */
|
used when converting links, but ignored when downloading. */
|
||||||
unsigned int ignore_when_downloading :1;
|
unsigned int ignore_when_downloading :1;
|
||||||
|
|
||||||
/* Information about the original link: */
|
/* Information about the original link: */
|
||||||
|
|
||||||
unsigned int link_relative_p :1; /* the link was relative */
|
unsigned int link_relative_p :1; /* the link was relative */
|
||||||
unsigned int link_complete_p :1; /* the link was complete (had host name) */
|
unsigned int link_complete_p :1; /* the link was complete (had host name) */
|
||||||
unsigned int link_base_p :1; /* the url came from <base href=...> */
|
unsigned int link_base_p :1; /* the url came from <base href=...> */
|
||||||
unsigned int link_inline_p :1; /* needed to render the page */
|
unsigned int link_inline_p :1; /* needed to render the page */
|
||||||
unsigned int link_css_p :1; /* the url came from CSS */
|
unsigned int link_css_p :1; /* the url came from CSS */
|
||||||
unsigned int link_expect_html :1; /* expected to contain HTML */
|
unsigned int link_expect_html :1; /* expected to contain HTML */
|
||||||
unsigned int link_expect_css :1; /* expected to contain CSS */
|
unsigned int link_expect_css :1; /* expected to contain CSS */
|
||||||
|
|
||||||
unsigned int link_refresh_p :1; /* link was received from
|
unsigned int link_refresh_p :1; /* link was received from
|
||||||
<meta http-equiv=refresh content=...> */
|
<meta http-equiv=refresh content=...> */
|
||||||
int refresh_timeout; /* for reconstructing the refresh. */
|
int refresh_timeout; /* for reconstructing the refresh. */
|
||||||
|
|
||||||
/* Conversion requirements: */
|
/* Conversion requirements: */
|
||||||
enum convert_options convert; /* is conversion required? */
|
enum convert_options convert; /* is conversion required? */
|
||||||
|
|
||||||
/* URL's position in the buffer. */
|
/* URL's position in the buffer. */
|
||||||
int pos, size;
|
int pos, size;
|
||||||
|
|
||||||
struct urlpos *next; /* next list element */
|
struct urlpos *next; /* next list element */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* downloaded_file() takes a parameter of this type and returns this type. */
|
/* downloaded_file() takes a parameter of this type and returns this type. */
|
||||||
|
@ -95,7 +95,7 @@ struct cookie {
|
|||||||
int port; /* port number */
|
int port; /* port number */
|
||||||
char *path; /* path prefix of the cookie */
|
char *path; /* path prefix of the cookie */
|
||||||
|
|
||||||
unsigned discard_requested :1; /* whether cookie was created to
|
unsigned discard_requested :1;/* whether cookie was created to
|
||||||
request discarding another
|
request discarding another
|
||||||
cookie. */
|
cookie. */
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ parse_set_cookie (const char *set_cookie, bool silent)
|
|||||||
|
|
||||||
/* Check if expiration spec is valid.
|
/* Check if expiration spec is valid.
|
||||||
If not, assume default (cookie doesn't expire, but valid only for
|
If not, assume default (cookie doesn't expire, but valid only for
|
||||||
this session.) */
|
this session.) */
|
||||||
expires = http_atotm (value_copy);
|
expires = http_atotm (value_copy);
|
||||||
if (expires != (time_t) -1)
|
if (expires != (time_t) -1)
|
||||||
{
|
{
|
||||||
@ -460,9 +460,9 @@ parse_set_cookie (const char *set_cookie, bool silent)
|
|||||||
|
|
||||||
|
|
||||||
#define REQUIRE_DIGITS(p) do { \
|
#define REQUIRE_DIGITS(p) do { \
|
||||||
if (!c_isdigit (*p)) \
|
if (!c_isdigit (*p)) \
|
||||||
return false; \
|
return false; \
|
||||||
for (++p; c_isdigit (*p); p++) \
|
for (++p; c_isdigit (*p); p++) \
|
||||||
; \
|
; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ struct cookie_jar *cookie_jar_new (void);
|
|||||||
void cookie_jar_delete (struct cookie_jar *);
|
void cookie_jar_delete (struct cookie_jar *);
|
||||||
|
|
||||||
void cookie_handle_set_cookie (struct cookie_jar *, const char *, int,
|
void cookie_handle_set_cookie (struct cookie_jar *, const char *, int,
|
||||||
const char *, const char *);
|
const char *, const char *);
|
||||||
char *cookie_header (struct cookie_jar *, const char *, int,
|
char *cookie_header (struct cookie_jar *, const char *, int,
|
||||||
const char *, bool);
|
const char *, bool);
|
||||||
|
|
||||||
void cookie_jar_load (struct cookie_jar *, const char *);
|
void cookie_jar_load (struct cookie_jar *, const char *);
|
||||||
void cookie_jar_save (struct cookie_jar *, const char *);
|
void cookie_jar_save (struct cookie_jar *, const char *);
|
||||||
|
@ -106,7 +106,7 @@ ftp_parse_unix_ls (const char *file, int ignore_perms)
|
|||||||
size_t bufsize = 0;
|
size_t bufsize = 0;
|
||||||
|
|
||||||
char *line = NULL, *tok, *ptok; /* tokenizer */
|
char *line = NULL, *tok, *ptok; /* tokenizer */
|
||||||
struct fileinfo *dir, *l, cur; /* list creation */
|
struct fileinfo *dir, *l, cur; /* list creation */
|
||||||
|
|
||||||
fp = fopen (file, "rb");
|
fp = fopen (file, "rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
|
58
src/ftp.h
58
src/ftp.h
@ -106,49 +106,49 @@ enum parsetype
|
|||||||
/* Information about one filename in a linked list. */
|
/* Information about one filename in a linked list. */
|
||||||
struct fileinfo
|
struct fileinfo
|
||||||
{
|
{
|
||||||
enum ftype type; /* file type */
|
enum ftype type; /* file type */
|
||||||
char *name; /* file name */
|
char *name; /* file name */
|
||||||
wgint size; /* file size */
|
wgint size; /* file size */
|
||||||
long tstamp; /* time-stamp */
|
long tstamp; /* time-stamp */
|
||||||
enum parsetype ptype; /* time parsing */
|
enum parsetype ptype; /* time parsing */
|
||||||
int perms; /* file permissions */
|
int perms; /* file permissions */
|
||||||
char *linkto; /* link to which file points */
|
char *linkto; /* link to which file points */
|
||||||
struct fileinfo *prev; /* previous... */
|
struct fileinfo *prev; /* previous... */
|
||||||
struct fileinfo *next; /* ...and next structure. */
|
struct fileinfo *next; /* ...and next structure. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Commands for FTP functions. */
|
/* Commands for FTP functions. */
|
||||||
enum wget_ftp_command
|
enum wget_ftp_command
|
||||||
{
|
{
|
||||||
DO_LOGIN = 0x0001, /* Connect and login to the server. */
|
DO_LOGIN = 0x0001, /* Connect and login to the server. */
|
||||||
DO_CWD = 0x0002, /* Change current directory. */
|
DO_CWD = 0x0002, /* Change current directory. */
|
||||||
DO_RETR = 0x0004, /* Retrieve the file. */
|
DO_RETR = 0x0004, /* Retrieve the file. */
|
||||||
DO_LIST = 0x0008, /* Retrieve the directory list. */
|
DO_LIST = 0x0008, /* Retrieve the directory list. */
|
||||||
LEAVE_PENDING = 0x0010 /* Do not close the socket. */
|
LEAVE_PENDING = 0x0010 /* Do not close the socket. */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum wget_ftp_fstatus
|
enum wget_ftp_fstatus
|
||||||
{
|
{
|
||||||
NOTHING = 0x0000, /* Nothing done yet. */
|
NOTHING = 0x0000, /* Nothing done yet. */
|
||||||
ON_YOUR_OWN = 0x0001, /* The ftp_loop_internal sets the
|
ON_YOUR_OWN = 0x0001, /* The ftp_loop_internal sets the
|
||||||
defaults. */
|
defaults. */
|
||||||
DONE_CWD = 0x0002, /* The current working directory is
|
DONE_CWD = 0x0002, /* The current working directory is
|
||||||
correct. */
|
correct. */
|
||||||
|
|
||||||
/* 2013-10-17 Andrea Urbani (matfanjol)
|
/* 2013-10-17 Andrea Urbani (matfanjol)
|
||||||
For more information about the following entries, please,
|
For more information about the following entries, please,
|
||||||
look at ftp.c, function getftp, text "__LIST_A_EXPLANATION__". */
|
look at ftp.c, function getftp, text "__LIST_A_EXPLANATION__". */
|
||||||
AVOID_LIST_A = 0x0004, /* It tells us if during this
|
AVOID_LIST_A = 0x0004, /* It tells us if during this
|
||||||
session we have to avoid the use
|
session we have to avoid the use
|
||||||
of "LIST -a".*/
|
of "LIST -a".*/
|
||||||
AVOID_LIST = 0x0008, /* It tells us if during this
|
AVOID_LIST = 0x0008, /* It tells us if during this
|
||||||
session we have to avoid to use
|
session we have to avoid to use
|
||||||
"LIST". */
|
"LIST". */
|
||||||
LIST_AFTER_LIST_A_CHECK_DONE = 0x0010
|
LIST_AFTER_LIST_A_CHECK_DONE = 0x0010
|
||||||
/* It tells us if we have already
|
/* It tells us if we have already
|
||||||
checked "LIST" after the first
|
checked "LIST" after the first
|
||||||
"LIST -a" to handle the case of
|
"LIST -a" to handle the case of
|
||||||
file/folders named "-a". */
|
file/folders named "-a". */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fileinfo *ftp_parse_ls (const char *, const enum stype);
|
struct fileinfo *ftp_parse_ls (const char *, const enum stype);
|
||||||
|
@ -133,8 +133,8 @@ inline
|
|||||||
#endif
|
#endif
|
||||||
static const char *
|
static const char *
|
||||||
pgettext_aux (const char *domain,
|
pgettext_aux (const char *domain,
|
||||||
const char *msg_ctxt_id, const char *msgid,
|
const char *msg_ctxt_id, const char *msgid,
|
||||||
int category)
|
int category)
|
||||||
{
|
{
|
||||||
const char *translation = dcgettext (domain, msg_ctxt_id, category);
|
const char *translation = dcgettext (domain, msg_ctxt_id, category);
|
||||||
if (translation == msg_ctxt_id)
|
if (translation == msg_ctxt_id)
|
||||||
@ -152,9 +152,9 @@ inline
|
|||||||
#endif
|
#endif
|
||||||
static const char *
|
static const char *
|
||||||
npgettext_aux (const char *domain,
|
npgettext_aux (const char *domain,
|
||||||
const char *msg_ctxt_id, const char *msgid,
|
const char *msg_ctxt_id, const char *msgid,
|
||||||
const char *msgid_plural, unsigned long int n,
|
const char *msgid_plural, unsigned long int n,
|
||||||
int category)
|
int category)
|
||||||
{
|
{
|
||||||
const char *translation =
|
const char *translation =
|
||||||
dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
||||||
@ -192,8 +192,8 @@ inline
|
|||||||
#endif
|
#endif
|
||||||
static const char *
|
static const char *
|
||||||
dcpgettext_expr (const char *domain,
|
dcpgettext_expr (const char *domain,
|
||||||
const char *msgctxt, const char *msgid,
|
const char *msgctxt, const char *msgid,
|
||||||
int category)
|
int category)
|
||||||
{
|
{
|
||||||
size_t msgctxt_len = strlen (msgctxt) + 1;
|
size_t msgctxt_len = strlen (msgctxt) + 1;
|
||||||
size_t msgid_len = strlen (msgid) + 1;
|
size_t msgid_len = strlen (msgid) + 1;
|
||||||
@ -215,10 +215,10 @@ dcpgettext_expr (const char *domain,
|
|||||||
translation = dcgettext (domain, msg_ctxt_id, category);
|
translation = dcgettext (domain, msg_ctxt_id, category);
|
||||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||||
if (msg_ctxt_id != buf)
|
if (msg_ctxt_id != buf)
|
||||||
free (msg_ctxt_id);
|
free (msg_ctxt_id);
|
||||||
#endif
|
#endif
|
||||||
if (translation != msg_ctxt_id)
|
if (translation != msg_ctxt_id)
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
return msgid;
|
return msgid;
|
||||||
}
|
}
|
||||||
@ -237,9 +237,9 @@ inline
|
|||||||
#endif
|
#endif
|
||||||
static const char *
|
static const char *
|
||||||
dcnpgettext_expr (const char *domain,
|
dcnpgettext_expr (const char *domain,
|
||||||
const char *msgctxt, const char *msgid,
|
const char *msgctxt, const char *msgid,
|
||||||
const char *msgid_plural, unsigned long int n,
|
const char *msgid_plural, unsigned long int n,
|
||||||
int category)
|
int category)
|
||||||
{
|
{
|
||||||
size_t msgctxt_len = strlen (msgctxt) + 1;
|
size_t msgctxt_len = strlen (msgctxt) + 1;
|
||||||
size_t msgid_len = strlen (msgid) + 1;
|
size_t msgid_len = strlen (msgid) + 1;
|
||||||
@ -261,10 +261,10 @@ dcnpgettext_expr (const char *domain,
|
|||||||
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
||||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||||
if (msg_ctxt_id != buf)
|
if (msg_ctxt_id != buf)
|
||||||
free (msg_ctxt_id);
|
free (msg_ctxt_id);
|
||||||
#endif
|
#endif
|
||||||
if (!(translation == msg_ctxt_id || translation == msgid_plural))
|
if (!(translation == msg_ctxt_id || translation == msgid_plural))
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
return (n == 1 ? msgid : msgid_plural);
|
return (n == 1 ? msgid : msgid_plural);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ as that of the covered work. */
|
|||||||
struct hash_table;
|
struct hash_table;
|
||||||
|
|
||||||
struct hash_table *hash_table_new (int, unsigned long (*) (const void *),
|
struct hash_table *hash_table_new (int, unsigned long (*) (const void *),
|
||||||
int (*) (const void *, const void *));
|
int (*) (const void *, const void *));
|
||||||
void hash_table_destroy (struct hash_table *);
|
void hash_table_destroy (struct hash_table *);
|
||||||
|
|
||||||
void *hash_table_get (const struct hash_table *, const void *);
|
void *hash_table_get (const struct hash_table *, const void *);
|
||||||
@ -47,11 +47,11 @@ int hash_table_remove (struct hash_table *, const void *);
|
|||||||
void hash_table_clear (struct hash_table *);
|
void hash_table_clear (struct hash_table *);
|
||||||
|
|
||||||
void hash_table_for_each (struct hash_table *,
|
void hash_table_for_each (struct hash_table *,
|
||||||
int (*) (void *, void *, void *), void *);
|
int (*) (void *, void *, void *), void *);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void *key, *value; /* public members */
|
void *key, *value; /* public members */
|
||||||
void *pos, *end; /* private members */
|
void *pos, *end; /* private members */
|
||||||
} hash_table_iterator;
|
} hash_table_iterator;
|
||||||
void hash_table_iterate (struct hash_table *, hash_table_iterator *);
|
void hash_table_iterate (struct hash_table *, hash_table_iterator *);
|
||||||
int hash_table_iter_next (hash_table_iterator *);
|
int hash_table_iter_next (hash_table_iterator *);
|
||||||
|
@ -58,9 +58,9 @@ typedef struct {
|
|||||||
|
|
||||||
/* The actual data, in the form of struct in_addr or in6_addr: */
|
/* The actual data, in the form of struct in_addr or in6_addr: */
|
||||||
union {
|
union {
|
||||||
struct in_addr d4; /* IPv4 address */
|
struct in_addr d4; /* IPv4 address */
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
struct in6_addr d6; /* IPv6 address */
|
struct in6_addr d6; /* IPv6 address */
|
||||||
#endif
|
#endif
|
||||||
} data;
|
} data;
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ as that of the covered work. */
|
|||||||
#define HTML_PARSE_H
|
#define HTML_PARSE_H
|
||||||
|
|
||||||
struct attr_pair {
|
struct attr_pair {
|
||||||
char *name; /* attribute name */
|
char *name; /* attribute name */
|
||||||
char *value; /* attribute value */
|
char *value; /* attribute value */
|
||||||
|
|
||||||
/* Needed for URL conversion; the places where the value begins and
|
/* Needed for URL conversion; the places where the value begins and
|
||||||
ends, including the quotes and everything. */
|
ends, including the quotes and everything. */
|
||||||
@ -45,19 +45,19 @@ struct attr_pair {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct taginfo {
|
struct taginfo {
|
||||||
char *name; /* tag name */
|
char *name; /* tag name */
|
||||||
int end_tag_p; /* whether this is an end-tag */
|
int end_tag_p; /* whether this is an end-tag */
|
||||||
int nattrs; /* number of attributes */
|
int nattrs; /* number of attributes */
|
||||||
struct attr_pair *attrs; /* attributes */
|
struct attr_pair *attrs; /* attributes */
|
||||||
|
|
||||||
const char *start_position; /* start position of tag */
|
const char *start_position; /* start position of tag */
|
||||||
const char *end_position; /* end position of tag */
|
const char *end_position; /* end position of tag */
|
||||||
|
|
||||||
const char *contents_begin; /* delimiters of tag contents */
|
const char *contents_begin; /* delimiters of tag contents */
|
||||||
const char *contents_end; /* only valid if end_tag_p */
|
const char *contents_end; /* only valid if end_tag_p */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hash_table; /* forward declaration */
|
struct hash_table; /* forward declaration */
|
||||||
|
|
||||||
/* Flags for map_html_tags: */
|
/* Flags for map_html_tags: */
|
||||||
#define MHT_STRICT_COMMENTS 1 /* use strict comment interpretation */
|
#define MHT_STRICT_COMMENTS 1 /* use strict comment interpretation */
|
||||||
@ -65,7 +65,7 @@ struct hash_table; /* forward declaration */
|
|||||||
<a href=" foo "> as "foo" */
|
<a href=" foo "> as "foo" */
|
||||||
|
|
||||||
void map_html_tags (const char *, int,
|
void map_html_tags (const char *, int,
|
||||||
void (*) (struct taginfo *, void *), void *, int,
|
void (*) (struct taginfo *, void *), void *, int,
|
||||||
const struct hash_table *, const struct hash_table *);
|
const struct hash_table *, const struct hash_table *);
|
||||||
|
|
||||||
#endif /* HTML_PARSE_H */
|
#endif /* HTML_PARSE_H */
|
||||||
|
@ -32,15 +32,15 @@ as that of the covered work. */
|
|||||||
#define HTML_URL_H
|
#define HTML_URL_H
|
||||||
|
|
||||||
struct map_context {
|
struct map_context {
|
||||||
char *text; /* HTML text. */
|
char *text; /* HTML text. */
|
||||||
char *base; /* Base URI of the document, possibly
|
char *base; /* Base URI of the document, possibly
|
||||||
changed through <base href=...>. */
|
changed through <base href=...>. */
|
||||||
const char *parent_base; /* Base of the current document. */
|
const char *parent_base; /* Base of the current document. */
|
||||||
const char *document_file; /* File name of this document. */
|
const char *document_file; /* File name of this document. */
|
||||||
bool nofollow; /* whether NOFOLLOW was specified in a
|
bool nofollow; /* whether NOFOLLOW was specified in a
|
||||||
<meta name=robots> tag. */
|
<meta name=robots> tag. */
|
||||||
|
|
||||||
struct urlpos *head; /* List of URLs that is being built. */
|
struct urlpos *head; /* List of URLs that is being built. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct urlpos *get_urls_file (const char *);
|
struct urlpos *get_urls_file (const char *);
|
||||||
|
56
src/http.c
56
src/http.c
@ -1016,13 +1016,13 @@ modify_param_name(param_token *name)
|
|||||||
else if(delim1 == delim2)
|
else if(delim1 == delim2)
|
||||||
{
|
{
|
||||||
if ((name->e - 1) == delim1)
|
if ((name->e - 1) == delim1)
|
||||||
{
|
{
|
||||||
result = RFC2231_ENCODING;
|
result = RFC2231_ENCODING;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = RFC2231_NOENCODING;
|
result = RFC2231_NOENCODING;
|
||||||
}
|
}
|
||||||
name->e = delim1;
|
name->e = delim1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1043,10 +1043,10 @@ modify_param_value (param_token *value, int encoding_type )
|
|||||||
if (encoding_type == RFC2231_ENCODING)
|
if (encoding_type == RFC2231_ENCODING)
|
||||||
{
|
{
|
||||||
const char *delim = memrchr (value->b, '\'', value->e - value->b);
|
const char *delim = memrchr (value->b, '\'', value->e - value->b);
|
||||||
if ( delim != NULL )
|
if (delim != NULL)
|
||||||
{
|
{
|
||||||
value->b = (delim+1);
|
value->b = (delim+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1154,7 +1154,7 @@ append_value_to_filename (char **filename, param_token const * const value,
|
|||||||
int original_length = strlen(*filename);
|
int original_length = strlen(*filename);
|
||||||
int new_length = strlen(*filename) + (value->e - value->b);
|
int new_length = strlen(*filename) + (value->e - value->b);
|
||||||
*filename = xrealloc (*filename, new_length+1);
|
*filename = xrealloc (*filename, new_length+1);
|
||||||
memcpy (*filename + original_length, value->b, (value->e - value->b));
|
memcpy (*filename + original_length, value->b, (value->e - value->b));
|
||||||
(*filename)[new_length] = '\0';
|
(*filename)[new_length] = '\0';
|
||||||
if (is_url_encoded)
|
if (is_url_encoded)
|
||||||
url_unescape (*filename + original_length);
|
url_unescape (*filename + original_length);
|
||||||
@ -1515,13 +1515,13 @@ File %s already there; not retrieving.\n\n"), quote (filename));
|
|||||||
url, warc_timestamp_str, warc_request_uuid, warc_ip, type
|
url, warc_timestamp_str, warc_request_uuid, warc_ip, type
|
||||||
and statcode will be saved in the headers of the WARC record.
|
and statcode will be saved in the headers of the WARC record.
|
||||||
The head parameter contains the HTTP headers of the response.
|
The head parameter contains the HTTP headers of the response.
|
||||||
|
|
||||||
If fp is NULL and WARC is enabled, the response body will be
|
If fp is NULL and WARC is enabled, the response body will be
|
||||||
written only to the WARC file. If WARC is disabled and fp
|
written only to the WARC file. If WARC is disabled and fp
|
||||||
is a file pointer, the data will be written to the file.
|
is a file pointer, the data will be written to the file.
|
||||||
If fp is a file pointer and WARC is enabled, the body will
|
If fp is a file pointer and WARC is enabled, the body will
|
||||||
be written to both destinations.
|
be written to both destinations.
|
||||||
|
|
||||||
Returns the error code. */
|
Returns the error code. */
|
||||||
static int
|
static int
|
||||||
read_response_body (struct http_stat *hs, int sock, FILE *fp, wgint contlen,
|
read_response_body (struct http_stat *hs, int sock, FILE *fp, wgint contlen,
|
||||||
@ -1610,7 +1610,7 @@ read_response_body (struct http_stat *hs, int sock, FILE *fp, wgint contlen,
|
|||||||
|
|
||||||
return RETRFINISHED;
|
return RETRFINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (warc_tmp != NULL)
|
if (warc_tmp != NULL)
|
||||||
fclose (warc_tmp);
|
fclose (warc_tmp);
|
||||||
|
|
||||||
@ -2651,7 +2651,7 @@ read_header:
|
|||||||
_("Location: %s%s\n"),
|
_("Location: %s%s\n"),
|
||||||
hs->newloc ? escnonprint_uri (hs->newloc) : _("unspecified"),
|
hs->newloc ? escnonprint_uri (hs->newloc) : _("unspecified"),
|
||||||
hs->newloc ? _(" [following]") : "");
|
hs->newloc ? _(" [following]") : "");
|
||||||
|
|
||||||
/* In case the caller cares to look... */
|
/* In case the caller cares to look... */
|
||||||
hs->len = 0;
|
hs->len = 0;
|
||||||
hs->res = 0;
|
hs->res = 0;
|
||||||
@ -2906,19 +2906,19 @@ read_header:
|
|||||||
}
|
}
|
||||||
else if (ALLOW_CLOBBER || count > 0)
|
else if (ALLOW_CLOBBER || count > 0)
|
||||||
{
|
{
|
||||||
if (opt.unlink && file_exists_p (hs->local_file))
|
if (opt.unlink && file_exists_p (hs->local_file))
|
||||||
{
|
{
|
||||||
int res = unlink (hs->local_file);
|
int res = unlink (hs->local_file);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
logprintf (LOG_NOTQUIET, "%s: %s\n", hs->local_file,
|
logprintf (LOG_NOTQUIET, "%s: %s\n", hs->local_file,
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
CLOSE_INVALIDATE (sock);
|
CLOSE_INVALIDATE (sock);
|
||||||
xfree (head);
|
xfree (head);
|
||||||
xfree_null (type);
|
xfree_null (type);
|
||||||
return UNLINKERR;
|
return UNLINKERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __VMS
|
#ifdef __VMS
|
||||||
int open_id;
|
int open_id;
|
||||||
|
20
src/init.c
20
src/init.c
@ -150,7 +150,7 @@ static const struct {
|
|||||||
{ "certificatetype", &opt.cert_type, cmd_cert_type },
|
{ "certificatetype", &opt.cert_type, cmd_cert_type },
|
||||||
{ "checkcertificate", &opt.check_cert, cmd_boolean },
|
{ "checkcertificate", &opt.check_cert, cmd_boolean },
|
||||||
#endif
|
#endif
|
||||||
{ "chooseconfig", &opt.choose_config, cmd_file },
|
{ "chooseconfig", &opt.choose_config, cmd_file },
|
||||||
{ "connecttimeout", &opt.connect_timeout, cmd_time },
|
{ "connecttimeout", &opt.connect_timeout, cmd_time },
|
||||||
{ "contentdisposition", &opt.content_disposition, cmd_boolean },
|
{ "contentdisposition", &opt.content_disposition, cmd_boolean },
|
||||||
{ "contentonerror", &opt.content_on_error, cmd_boolean },
|
{ "contentonerror", &opt.content_on_error, cmd_boolean },
|
||||||
@ -821,16 +821,16 @@ setval_internal_tilde (int comind, const char *com, const char *val)
|
|||||||
pstring = commands[comind].place;
|
pstring = commands[comind].place;
|
||||||
home = home_dir ();
|
home = home_dir ();
|
||||||
if (home)
|
if (home)
|
||||||
{
|
{
|
||||||
homelen = strlen (home);
|
homelen = strlen (home);
|
||||||
while (homelen && ISSEP (home[homelen - 1]))
|
while (homelen && ISSEP (home[homelen - 1]))
|
||||||
home[--homelen] = '\0';
|
home[--homelen] = '\0';
|
||||||
|
|
||||||
/* Skip the leading "~/". */
|
/* Skip the leading "~/". */
|
||||||
for (++val; ISSEP (*val); val++)
|
for (++val; ISSEP (*val); val++)
|
||||||
;
|
;
|
||||||
*pstring = concat_strings (home, "/", val, (char *)0);
|
*pstring = concat_strings (home, "/", val, (char *)0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
290
src/main.c
290
src/main.c
@ -430,234 +430,234 @@ Mandatory arguments to long options are mandatory for short options too.\n\n"),
|
|||||||
N_("\
|
N_("\
|
||||||
Startup:\n"),
|
Startup:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-V, --version display the version of Wget and exit.\n"),
|
-V, --version display the version of Wget and exit.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-h, --help print this help.\n"),
|
-h, --help print this help.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-b, --background go to background after startup.\n"),
|
-b, --background go to background after startup.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-e, --execute=COMMAND execute a `.wgetrc'-style command.\n"),
|
-e, --execute=COMMAND execute a `.wgetrc'-style command.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
Logging and input file:\n"),
|
Logging and input file:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-o, --output-file=FILE log messages to FILE.\n"),
|
-o, --output-file=FILE log messages to FILE.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-a, --append-output=FILE append messages to FILE.\n"),
|
-a, --append-output=FILE append messages to FILE.\n"),
|
||||||
#ifdef ENABLE_DEBUG
|
#ifdef ENABLE_DEBUG
|
||||||
N_("\
|
N_("\
|
||||||
-d, --debug print lots of debugging information.\n"),
|
-d, --debug print lots of debugging information.\n"),
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_WATT32
|
#ifdef USE_WATT32
|
||||||
N_("\
|
N_("\
|
||||||
--wdebug print Watt-32 debug output.\n"),
|
--wdebug print Watt-32 debug output.\n"),
|
||||||
#endif
|
#endif
|
||||||
N_("\
|
N_("\
|
||||||
-q, --quiet quiet (no output).\n"),
|
-q, --quiet quiet (no output).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-v, --verbose be verbose (this is the default).\n"),
|
-v, --verbose be verbose (this is the default).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-nv, --no-verbose turn off verboseness, without being quiet.\n"),
|
-nv, --no-verbose turn off verboseness, without being quiet.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--report-speed=TYPE Output bandwidth as TYPE. TYPE can be bits.\n"),
|
--report-speed=TYPE Output bandwidth as TYPE. TYPE can be bits.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-i, --input-file=FILE download URLs found in local or external FILE.\n"),
|
-i, --input-file=FILE download URLs found in local or external FILE.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-F, --force-html treat input file as HTML.\n"),
|
-F, --force-html treat input file as HTML.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-B, --base=URL resolves HTML input-file links (-i -F)\n\
|
-B, --base=URL resolves HTML input-file links (-i -F)\n\
|
||||||
relative to URL.\n"),
|
relative to URL.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--config=FILE Specify config file to use.\n"),
|
--config=FILE Specify config file to use.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-config Do not read any config file.\n"),
|
--no-config Do not read any config file.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
Download:\n"),
|
Download:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).\n"),
|
-t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--retry-connrefused retry even if connection is refused.\n"),
|
--retry-connrefused retry even if connection is refused.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-O, --output-document=FILE write documents to FILE.\n"),
|
-O, --output-document=FILE write documents to FILE.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-nc, --no-clobber skip downloads that would download to\n\
|
-nc, --no-clobber skip downloads that would download to\n\
|
||||||
existing files (overwriting them).\n"),
|
existing files (overwriting them).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-c, --continue resume getting a partially-downloaded file.\n"),
|
-c, --continue resume getting a partially-downloaded file.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--start-pos=OFFSET start downloading from zero-based position OFFSET.\n"),
|
--start-pos=OFFSET start downloading from zero-based position OFFSET.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--progress=TYPE select progress gauge type.\n"),
|
--progress=TYPE select progress gauge type.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--show-progress display the progress bar in any verbosity mode.\n"),
|
--show-progress display the progress bar in any verbosity mode.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-N, --timestamping don't re-retrieve files unless newer than\n\
|
-N, --timestamping don't re-retrieve files unless newer than\n\
|
||||||
local.\n"),
|
local.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-use-server-timestamps don't set the local file's timestamp by\n\
|
--no-use-server-timestamps don't set the local file's timestamp by\n\
|
||||||
the one on the server.\n"),
|
the one on the server.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-S, --server-response print server response.\n"),
|
-S, --server-response print server response.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--spider don't download anything.\n"),
|
--spider don't download anything.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-T, --timeout=SECONDS set all timeout values to SECONDS.\n"),
|
-T, --timeout=SECONDS set all timeout values to SECONDS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--dns-timeout=SECS set the DNS lookup timeout to SECS.\n"),
|
--dns-timeout=SECS set the DNS lookup timeout to SECS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--connect-timeout=SECS set the connect timeout to SECS.\n"),
|
--connect-timeout=SECS set the connect timeout to SECS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--read-timeout=SECS set the read timeout to SECS.\n"),
|
--read-timeout=SECS set the read timeout to SECS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-w, --wait=SECONDS wait SECONDS between retrievals.\n"),
|
-w, --wait=SECONDS wait SECONDS between retrievals.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--waitretry=SECONDS wait 1..SECONDS between retries of a retrieval.\n"),
|
--waitretry=SECONDS wait 1..SECONDS between retries of a retrieval.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--random-wait wait from 0.5*WAIT...1.5*WAIT secs between retrievals.\n"),
|
--random-wait wait from 0.5*WAIT...1.5*WAIT secs between retrievals.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-proxy explicitly turn off proxy.\n"),
|
--no-proxy explicitly turn off proxy.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-Q, --quota=NUMBER set retrieval quota to NUMBER.\n"),
|
-Q, --quota=NUMBER set retrieval quota to NUMBER.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host.\n"),
|
--bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--limit-rate=RATE limit download rate to RATE.\n"),
|
--limit-rate=RATE limit download rate to RATE.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-dns-cache disable caching DNS lookups.\n"),
|
--no-dns-cache disable caching DNS lookups.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--restrict-file-names=OS restrict chars in file names to ones OS allows.\n"),
|
--restrict-file-names=OS restrict chars in file names to ones OS allows.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--ignore-case ignore case when matching files/directories.\n"),
|
--ignore-case ignore case when matching files/directories.\n"),
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
N_("\
|
N_("\
|
||||||
-4, --inet4-only connect only to IPv4 addresses.\n"),
|
-4, --inet4-only connect only to IPv4 addresses.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-6, --inet6-only connect only to IPv6 addresses.\n"),
|
-6, --inet6-only connect only to IPv6 addresses.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--prefer-family=FAMILY connect first to addresses of specified family,\n\
|
--prefer-family=FAMILY connect first to addresses of specified family,\n\
|
||||||
one of IPv6, IPv4, or none.\n"),
|
one of IPv6, IPv4, or none.\n"),
|
||||||
#endif
|
#endif
|
||||||
N_("\
|
N_("\
|
||||||
--user=USER set both ftp and http user to USER.\n"),
|
--user=USER set both ftp and http user to USER.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--password=PASS set both ftp and http password to PASS.\n"),
|
--password=PASS set both ftp and http password to PASS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--ask-password prompt for passwords.\n"),
|
--ask-password prompt for passwords.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-iri turn off IRI support.\n"),
|
--no-iri turn off IRI support.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--local-encoding=ENC use ENC as the local encoding for IRIs.\n"),
|
--local-encoding=ENC use ENC as the local encoding for IRIs.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--remote-encoding=ENC use ENC as the default remote encoding.\n"),
|
--remote-encoding=ENC use ENC as the default remote encoding.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--unlink remove file before clobber.\n"),
|
--unlink remove file before clobber.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
Directories:\n"),
|
Directories:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-nd, --no-directories don't create directories.\n"),
|
-nd, --no-directories don't create directories.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-x, --force-directories force creation of directories.\n"),
|
-x, --force-directories force creation of directories.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-nH, --no-host-directories don't create host directories.\n"),
|
-nH, --no-host-directories don't create host directories.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--protocol-directories use protocol name in directories.\n"),
|
--protocol-directories use protocol name in directories.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-P, --directory-prefix=PREFIX save files to PREFIX/...\n"),
|
-P, --directory-prefix=PREFIX save files to PREFIX/...\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--cut-dirs=NUMBER ignore NUMBER remote directory components.\n"),
|
--cut-dirs=NUMBER ignore NUMBER remote directory components.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
HTTP options:\n"),
|
HTTP options:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--http-user=USER set http user to USER.\n"),
|
--http-user=USER set http user to USER.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--http-password=PASS set http password to PASS.\n"),
|
--http-password=PASS set http password to PASS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-cache disallow server-cached data.\n"),
|
--no-cache disallow server-cached data.\n"),
|
||||||
N_ ("\
|
N_ ("\
|
||||||
--default-page=NAME Change the default page name (normally\n\
|
--default-page=NAME Change the default page name (normally\n\
|
||||||
this is `index.html'.).\n"),
|
this is `index.html'.).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-E, --adjust-extension save HTML/CSS documents with proper extensions.\n"),
|
-E, --adjust-extension save HTML/CSS documents with proper extensions.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--ignore-length ignore `Content-Length' header field.\n"),
|
--ignore-length ignore `Content-Length' header field.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--header=STRING insert STRING among the headers.\n"),
|
--header=STRING insert STRING among the headers.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--max-redirect maximum redirections allowed per page.\n"),
|
--max-redirect maximum redirections allowed per page.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--proxy-user=USER set USER as proxy username.\n"),
|
--proxy-user=USER set USER as proxy username.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--proxy-password=PASS set PASS as proxy password.\n"),
|
--proxy-password=PASS set PASS as proxy password.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--referer=URL include `Referer: URL' header in HTTP request.\n"),
|
--referer=URL include `Referer: URL' header in HTTP request.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--save-headers save the HTTP headers to file.\n"),
|
--save-headers save the HTTP headers to file.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION.\n"),
|
-U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-http-keep-alive disable HTTP keep-alive (persistent connections).\n"),
|
--no-http-keep-alive disable HTTP keep-alive (persistent connections).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-cookies don't use cookies.\n"),
|
--no-cookies don't use cookies.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--load-cookies=FILE load cookies from FILE before session.\n"),
|
--load-cookies=FILE load cookies from FILE before session.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--save-cookies=FILE save cookies to FILE after session.\n"),
|
--save-cookies=FILE save cookies to FILE after session.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--keep-session-cookies load and save session (non-permanent) cookies.\n"),
|
--keep-session-cookies load and save session (non-permanent) cookies.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--post-data=STRING use the POST method; send STRING as the data.\n"),
|
--post-data=STRING use the POST method; send STRING as the data.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--post-file=FILE use the POST method; send contents of FILE.\n"),
|
--post-file=FILE use the POST method; send contents of FILE.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--method=HTTPMethod use method \"HTTPMethod\" in the header.\n"),
|
--method=HTTPMethod use method \"HTTPMethod\" in the header.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--body-data=STRING Send STRING as data. --method MUST be set.\n"),
|
--body-data=STRING Send STRING as data. --method MUST be set.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--body-file=FILE Send contents of FILE. --method MUST be set.\n"),
|
--body-file=FILE Send contents of FILE. --method MUST be set.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--content-disposition honor the Content-Disposition header when\n\
|
--content-disposition honor the Content-Disposition header when\n\
|
||||||
choosing local file names (EXPERIMENTAL).\n"),
|
choosing local file names (EXPERIMENTAL).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--content-on-error output the received content on server errors.\n"),
|
--content-on-error output the received content on server errors.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--auth-no-challenge send Basic HTTP authentication information\n\
|
--auth-no-challenge send Basic HTTP authentication information\n\
|
||||||
without first waiting for the server's\n\
|
without first waiting for the server's\n\
|
||||||
challenge.\n"),
|
challenge.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
N_("\
|
N_("\
|
||||||
HTTPS (SSL/TLS) options:\n"),
|
HTTPS (SSL/TLS) options:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--secure-protocol=PR choose secure protocol, one of auto, SSLv2,\n\
|
--secure-protocol=PR choose secure protocol, one of auto, SSLv2,\n\
|
||||||
SSLv3, TLSv1 and PFS.\n"),
|
SSLv3, TLSv1 and PFS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--https-only only follow secure HTTPS links\n"),
|
--https-only only follow secure HTTPS links\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-check-certificate don't validate the server's certificate.\n"),
|
--no-check-certificate don't validate the server's certificate.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--certificate=FILE client certificate file.\n"),
|
--certificate=FILE client certificate file.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--certificate-type=TYPE client certificate type, PEM or DER.\n"),
|
--certificate-type=TYPE client certificate type, PEM or DER.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--private-key=FILE private key file.\n"),
|
--private-key=FILE private key file.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--private-key-type=TYPE private key type, PEM or DER.\n"),
|
--private-key-type=TYPE private key type, PEM or DER.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--ca-certificate=FILE file with the bundle of CA's.\n"),
|
--ca-certificate=FILE file with the bundle of CA's.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--ca-directory=DIR directory where hash list of CA's is stored.\n"),
|
--ca-directory=DIR directory where hash list of CA's is stored.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--random-file=FILE file with random data for seeding the SSL PRNG.\n"),
|
--random-file=FILE file with random data for seeding the SSL PRNG.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--egd-file=FILE file naming the EGD socket with random data.\n"),
|
--egd-file=FILE file naming the EGD socket with random data.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
|
|
||||||
@ -665,76 +665,76 @@ HTTPS (SSL/TLS) options:\n"),
|
|||||||
FTP options:\n"),
|
FTP options:\n"),
|
||||||
#ifdef __VMS
|
#ifdef __VMS
|
||||||
N_("\
|
N_("\
|
||||||
--ftp-stmlf Use Stream_LF format for all binary FTP files.\n"),
|
--ftp-stmlf Use Stream_LF format for all binary FTP files.\n"),
|
||||||
#endif /* def __VMS */
|
#endif /* def __VMS */
|
||||||
N_("\
|
N_("\
|
||||||
--ftp-user=USER set ftp user to USER.\n"),
|
--ftp-user=USER set ftp user to USER.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--ftp-password=PASS set ftp password to PASS.\n"),
|
--ftp-password=PASS set ftp password to PASS.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-remove-listing don't remove `.listing' files.\n"),
|
--no-remove-listing don't remove `.listing' files.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-glob turn off FTP file name globbing.\n"),
|
--no-glob turn off FTP file name globbing.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-passive-ftp disable the \"passive\" transfer mode.\n"),
|
--no-passive-ftp disable the \"passive\" transfer mode.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--preserve-permissions preserve remote file permissions.\n"),
|
--preserve-permissions preserve remote file permissions.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--retr-symlinks when recursing, get linked-to files (not dir).\n"),
|
--retr-symlinks when recursing, get linked-to files (not dir).\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
WARC options:\n"),
|
WARC options:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--warc-file=FILENAME save request/response data to a .warc.gz file.\n"),
|
--warc-file=FILENAME save request/response data to a .warc.gz file.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--warc-header=STRING insert STRING into the warcinfo record.\n"),
|
--warc-header=STRING insert STRING into the warcinfo record.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--warc-max-size=NUMBER set maximum size of WARC files to NUMBER.\n"),
|
--warc-max-size=NUMBER set maximum size of WARC files to NUMBER.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--warc-cdx write CDX index files.\n"),
|
--warc-cdx write CDX index files.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--warc-dedup=FILENAME do not store records listed in this CDX file.\n"),
|
--warc-dedup=FILENAME do not store records listed in this CDX file.\n"),
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
N_("\
|
N_("\
|
||||||
--no-warc-compression do not compress WARC files with GZIP.\n"),
|
--no-warc-compression do not compress WARC files with GZIP.\n"),
|
||||||
#endif
|
#endif
|
||||||
N_("\
|
N_("\
|
||||||
--no-warc-digests do not calculate SHA1 digests.\n"),
|
--no-warc-digests do not calculate SHA1 digests.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--no-warc-keep-log do not store the log file in a WARC record.\n"),
|
--no-warc-keep-log do not store the log file in a WARC record.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--warc-tempdir=DIRECTORY location for temporary files created by the\n\
|
--warc-tempdir=DIRECTORY location for temporary files created by the\n\
|
||||||
WARC writer.\n"),
|
WARC writer.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
Recursive download:\n"),
|
Recursive download:\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-r, --recursive specify recursive download.\n"),
|
-r, --recursive specify recursive download.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).\n"),
|
-l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--delete-after delete files locally after downloading them.\n"),
|
--delete-after delete files locally after downloading them.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-k, --convert-links make links in downloaded HTML or CSS point to\n\
|
-k, --convert-links make links in downloaded HTML or CSS point to\n\
|
||||||
local files.\n"),
|
local files.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--backups=N before writing file X, rotate up to N backup files.\n"),
|
--backups=N before writing file X, rotate up to N backup files.\n"),
|
||||||
|
|
||||||
#ifdef __VMS
|
#ifdef __VMS
|
||||||
N_("\
|
N_("\
|
||||||
-K, --backup-converted before converting file X, back up as X_orig.\n"),
|
-K, --backup-converted before converting file X, back up as X_orig.\n"),
|
||||||
#else /* def __VMS */
|
#else /* def __VMS */
|
||||||
N_("\
|
N_("\
|
||||||
-K, --backup-converted before converting file X, back up as X.orig.\n"),
|
-K, --backup-converted before converting file X, back up as X.orig.\n"),
|
||||||
#endif /* def __VMS [else] */
|
#endif /* def __VMS [else] */
|
||||||
N_("\
|
N_("\
|
||||||
-m, --mirror shortcut for -N -r -l inf --no-remove-listing.\n"),
|
-m, --mirror shortcut for -N -r -l inf --no-remove-listing.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-p, --page-requisites get all images, etc. needed to display HTML page.\n"),
|
-p, --page-requisites get all images, etc. needed to display HTML page.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--strict-comments turn on strict (SGML) handling of HTML comments.\n"),
|
--strict-comments turn on strict (SGML) handling of HTML comments.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
@ -771,7 +771,7 @@ Recursive accept/reject:\n"),
|
|||||||
N_("\
|
N_("\
|
||||||
-I, --include-directories=LIST list of allowed directories.\n"),
|
-I, --include-directories=LIST list of allowed directories.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--trust-server-names use the name specified by the redirection\n\
|
--trust-server-names use the name specified by the redirection\n\
|
||||||
url last component.\n"),
|
url last component.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-X, --exclude-directories=LIST list of excluded directories.\n"),
|
-X, --exclude-directories=LIST list of excluded directories.\n"),
|
||||||
@ -1104,7 +1104,7 @@ main (int argc, char **argv)
|
|||||||
print_usage (1);
|
print_usage (1);
|
||||||
fprintf (stderr, "\n");
|
fprintf (stderr, "\n");
|
||||||
fprintf (stderr, _("Try `%s --help' for more options.\n"),
|
fprintf (stderr, _("Try `%s --help' for more options.\n"),
|
||||||
exec_name);
|
exec_name);
|
||||||
exit (2);
|
exit (2);
|
||||||
}
|
}
|
||||||
/* Find the short option character in the mapping. */
|
/* Find the short option character in the mapping. */
|
||||||
@ -1709,14 +1709,14 @@ outputting to a regular file.\n"));
|
|||||||
char *wall_time = xstrdup (secs_to_human_time (end_time - start_time));
|
char *wall_time = xstrdup (secs_to_human_time (end_time - start_time));
|
||||||
char *download_time = xstrdup (secs_to_human_time (total_download_time));
|
char *download_time = xstrdup (secs_to_human_time (total_download_time));
|
||||||
logprintf (LOG_NOTQUIET,
|
logprintf (LOG_NOTQUIET,
|
||||||
_("FINISHED --%s--\nTotal wall clock time: %s\n"
|
_("FINISHED --%s--\nTotal wall clock time: %s\n"
|
||||||
"Downloaded: %d files, %s in %s (%s)\n"),
|
"Downloaded: %d files, %s in %s (%s)\n"),
|
||||||
datetime_str (time (NULL)),
|
datetime_str (time (NULL)),
|
||||||
wall_time,
|
wall_time,
|
||||||
numurls,
|
numurls,
|
||||||
human_readable (total_downloaded_bytes, 10, 1),
|
human_readable (total_downloaded_bytes, 10, 1),
|
||||||
download_time,
|
download_time,
|
||||||
retr_rate (total_downloaded_bytes, total_download_time));
|
retr_rate (total_downloaded_bytes, total_download_time));
|
||||||
xfree (wall_time);
|
xfree (wall_time);
|
||||||
xfree (download_time);
|
xfree (download_time);
|
||||||
|
|
||||||
|
@ -620,35 +620,35 @@ inet_ntop (int af, const void *src, char *dst, socklen_t cnt)
|
|||||||
void
|
void
|
||||||
set_windows_fd_as_blocking_socket (int fd)
|
set_windows_fd_as_blocking_socket (int fd)
|
||||||
{
|
{
|
||||||
/* 04/2011
|
/* 04/2011
|
||||||
gnulib select() converts blocking sockets to nonblocking in windows
|
gnulib select() converts blocking sockets to nonblocking in windows
|
||||||
discussed here:
|
discussed here:
|
||||||
http://old.nabble.com/blocking-socket-is-nonblocking-after-calling-gnulib-
|
http://old.nabble.com/blocking-socket-is-nonblocking-after-calling-gnulib-
|
||||||
select%28%29-in-windows-td31432857.html
|
select%28%29-in-windows-td31432857.html
|
||||||
|
|
||||||
wget uses blocking sockets so we must convert them back to blocking.
|
wget uses blocking sockets so we must convert them back to blocking.
|
||||||
*/
|
*/
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int wsagle = 0;
|
int wsagle = 0;
|
||||||
const int zero = 0;
|
const int zero = 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if(wsagle == WSAEINPROGRESS)
|
if(wsagle == WSAEINPROGRESS)
|
||||||
Sleep(1); /* use windows sleep */
|
Sleep(1); /* use windows sleep */
|
||||||
|
|
||||||
WSASetLastError (0);
|
WSASetLastError (0);
|
||||||
ret = ioctl (fd, FIONBIO, &zero);
|
ret = ioctl (fd, FIONBIO, &zero);
|
||||||
wsagle = WSAGetLastError();
|
wsagle = WSAGetLastError ();
|
||||||
}
|
}
|
||||||
while (ret && (wsagle == WSAEINPROGRESS));
|
while (ret && (wsagle == WSAEINPROGRESS));
|
||||||
|
|
||||||
if(ret)
|
if(ret)
|
||||||
{
|
{
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("ioctl() failed. The socket could not be set as blocking.\n") );
|
_("ioctl() failed. The socket could not be set as blocking.\n") );
|
||||||
DEBUGP (("Winsock error: %d\n", WSAGetLastError ()));
|
DEBUGP (("Winsock error: %d\n", WSAGetLastError ()));
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -33,10 +33,10 @@ as that of the covered work. */
|
|||||||
|
|
||||||
typedef struct _acc_t
|
typedef struct _acc_t
|
||||||
{
|
{
|
||||||
char *host; /* NULL if this is the default machine
|
char *host; /* NULL if this is the default machine
|
||||||
entry. */
|
entry. */
|
||||||
char *acc;
|
char *acc;
|
||||||
char *passwd; /* NULL if there is no password. */
|
char *passwd; /* NULL if there is no password. */
|
||||||
struct _acc_t *next;
|
struct _acc_t *next;
|
||||||
} acc_t;
|
} acc_t;
|
||||||
|
|
||||||
|
@ -459,10 +459,10 @@ ssl_connect_wget (int fd, const char *hostname)
|
|||||||
if (! is_valid_ip_address (hostname))
|
if (! is_valid_ip_address (hostname))
|
||||||
{
|
{
|
||||||
if (! SSL_set_tlsext_host_name (conn, hostname))
|
if (! SSL_set_tlsext_host_name (conn, hostname))
|
||||||
{
|
{
|
||||||
DEBUGP (("Failed to set TLS server-name indication."));
|
DEBUGP (("Failed to set TLS server-name indication."));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -712,7 +712,7 @@ ssl_check_certificate (int fd, const char *host)
|
|||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alt_name_checked == false)
|
if (alt_name_checked == false)
|
||||||
{
|
{
|
||||||
/* Test commomName */
|
/* Test commomName */
|
||||||
|
303
src/options.h
303
src/options.h
@ -31,171 +31,170 @@ as that of the covered work. */
|
|||||||
|
|
||||||
struct options
|
struct options
|
||||||
{
|
{
|
||||||
int verbose; /* Are we verbose? (First set to -1,
|
int verbose; /* Are we verbose? (First set to -1,
|
||||||
hence not boolean.) */
|
hence not boolean.) */
|
||||||
bool quiet; /* Are we quiet? */
|
bool quiet; /* Are we quiet? */
|
||||||
int ntry; /* Number of tries per URL */
|
int ntry; /* Number of tries per URL */
|
||||||
bool retry_connrefused; /* Treat CONNREFUSED as non-fatal. */
|
bool retry_connrefused; /* Treat CONNREFUSED as non-fatal. */
|
||||||
bool background; /* Whether we should work in background. */
|
bool background; /* Whether we should work in background. */
|
||||||
bool ignore_length; /* Do we heed content-length at all? */
|
bool ignore_length; /* Do we heed content-length at all? */
|
||||||
bool recursive; /* Are we recursive? */
|
bool recursive; /* Are we recursive? */
|
||||||
bool spanhost; /* Do we span across hosts in
|
bool spanhost; /* Do we span across hosts in
|
||||||
recursion? */
|
recursion? */
|
||||||
int max_redirect; /* Maximum number of times we'll allow
|
int max_redirect; /* Maximum number of times we'll allow
|
||||||
a page to redirect. */
|
a page to redirect. */
|
||||||
bool relative_only; /* Follow only relative links. */
|
bool relative_only; /* Follow only relative links. */
|
||||||
bool no_parent; /* Restrict access to the parent
|
bool no_parent; /* Restrict access to the parent
|
||||||
directory. */
|
directory. */
|
||||||
int reclevel; /* Maximum level of recursion */
|
int reclevel; /* Maximum level of recursion */
|
||||||
bool dirstruct; /* Do we build the directory structure
|
bool dirstruct; /* Do we build the directory structure
|
||||||
as we go along? */
|
as we go along? */
|
||||||
bool no_dirstruct; /* Do we hate dirstruct? */
|
bool no_dirstruct; /* Do we hate dirstruct? */
|
||||||
int cut_dirs; /* Number of directory components to cut. */
|
int cut_dirs; /* Number of directory components to cut. */
|
||||||
bool add_hostdir; /* Do we add hostname directory? */
|
bool add_hostdir; /* Do we add hostname directory? */
|
||||||
bool protocol_directories; /* Whether to prepend "http"/"ftp" to dirs. */
|
bool protocol_directories; /* Whether to prepend "http"/"ftp" to dirs. */
|
||||||
bool noclobber; /* Disables clobbering of existing
|
bool noclobber; /* Disables clobbering of existing data. */
|
||||||
data. */
|
bool unlink; /* remove file before clobbering */
|
||||||
bool unlink; /* remove file before clobbering */
|
char *dir_prefix; /* The top of directory tree */
|
||||||
char *dir_prefix; /* The top of directory tree */
|
char *lfilename; /* Log filename */
|
||||||
char *lfilename; /* Log filename */
|
char *input_filename; /* Input filename */
|
||||||
char *input_filename; /* Input filename */
|
char *choose_config; /* Specified config file */
|
||||||
char *choose_config; /* Specified config file */
|
bool noconfig; /* Ignore all config files? */
|
||||||
bool noconfig;
|
bool force_html; /* Is the input file an HTML file? */
|
||||||
bool force_html; /* Is the input file an HTML file? */
|
|
||||||
|
|
||||||
char *default_page; /* Alternative default page (index file) */
|
char *default_page; /* Alternative default page (index file) */
|
||||||
|
|
||||||
bool spider; /* Is Wget in spider mode? */
|
bool spider; /* Is Wget in spider mode? */
|
||||||
|
|
||||||
char **accepts; /* List of patterns to accept. */
|
char **accepts; /* List of patterns to accept. */
|
||||||
char **rejects; /* List of patterns to reject. */
|
char **rejects; /* List of patterns to reject. */
|
||||||
const char **excludes; /* List of excluded FTP directories. */
|
const char **excludes; /* List of excluded FTP directories. */
|
||||||
const char **includes; /* List of FTP directories to
|
const char **includes; /* List of FTP directories to
|
||||||
follow. */
|
follow. */
|
||||||
bool ignore_case; /* Whether to ignore case when
|
bool ignore_case; /* Whether to ignore case when
|
||||||
matching dirs and files */
|
matching dirs and files */
|
||||||
|
|
||||||
char *acceptregex_s; /* Patterns to accept (a regex string). */
|
char *acceptregex_s; /* Patterns to accept (a regex string). */
|
||||||
char *rejectregex_s; /* Patterns to reject (a regex string). */
|
char *rejectregex_s; /* Patterns to reject (a regex string). */
|
||||||
void *acceptregex; /* Patterns to accept (a regex struct). */
|
void *acceptregex; /* Patterns to accept (a regex struct). */
|
||||||
void *rejectregex; /* Patterns to reject (a regex struct). */
|
void *rejectregex; /* Patterns to reject (a regex struct). */
|
||||||
enum {
|
enum {
|
||||||
#ifdef HAVE_LIBPCRE
|
#ifdef HAVE_LIBPCRE
|
||||||
regex_type_pcre,
|
regex_type_pcre,
|
||||||
#endif
|
#endif
|
||||||
regex_type_posix
|
regex_type_posix
|
||||||
} regex_type; /* The regex library. */
|
} regex_type; /* The regex library. */
|
||||||
void *(*regex_compile_fun)(const char *); /* Function to compile a regex. */
|
void *(*regex_compile_fun)(const char *); /* Function to compile a regex. */
|
||||||
bool (*regex_match_fun)(const void *, const char *); /* Function to match a string to a regex. */
|
bool (*regex_match_fun)(const void *, const char *); /* Function to match a string to a regex. */
|
||||||
|
|
||||||
char **domains; /* See host.c */
|
char **domains; /* See host.c */
|
||||||
char **exclude_domains;
|
char **exclude_domains;
|
||||||
bool dns_cache; /* whether we cache DNS lookups. */
|
bool dns_cache; /* whether we cache DNS lookups. */
|
||||||
|
|
||||||
char **follow_tags; /* List of HTML tags to recursively follow. */
|
char **follow_tags; /* List of HTML tags to recursively follow. */
|
||||||
char **ignore_tags; /* List of HTML tags to ignore if recursing. */
|
char **ignore_tags; /* List of HTML tags to ignore if recursing. */
|
||||||
|
|
||||||
bool follow_ftp; /* Are FTP URL-s followed in recursive
|
bool follow_ftp; /* Are FTP URL-s followed in recursive
|
||||||
retrieving? */
|
retrieving? */
|
||||||
bool retr_symlinks; /* Whether we retrieve symlinks in
|
bool retr_symlinks; /* Whether we retrieve symlinks in
|
||||||
FTP. */
|
FTP. */
|
||||||
char *output_document; /* The output file to which the
|
char *output_document; /* The output file to which the
|
||||||
documents will be printed. */
|
documents will be printed. */
|
||||||
char *warc_filename; /* WARC output filename */
|
char *warc_filename; /* WARC output filename */
|
||||||
char *warc_tempdir; /* WARC temp dir */
|
char *warc_tempdir; /* WARC temp dir */
|
||||||
char *warc_cdx_dedup_filename; /* CDX file to be used for deduplication. */
|
char *warc_cdx_dedup_filename;/* CDX file to be used for deduplication. */
|
||||||
wgint warc_maxsize; /* WARC max archive size */
|
wgint warc_maxsize; /* WARC max archive size */
|
||||||
bool warc_compression_enabled; /* For GZIP compression. */
|
bool warc_compression_enabled;/* For GZIP compression. */
|
||||||
bool warc_digests_enabled; /* For SHA1 digests. */
|
bool warc_digests_enabled; /* For SHA1 digests. */
|
||||||
bool warc_cdx_enabled; /* Create CDX files? */
|
bool warc_cdx_enabled; /* Create CDX files? */
|
||||||
bool warc_keep_log; /* Store the log file in a WARC record. */
|
bool warc_keep_log; /* Store the log file in a WARC record. */
|
||||||
char **warc_user_headers; /* User-defined WARC header(s). */
|
char **warc_user_headers; /* User-defined WARC header(s). */
|
||||||
|
|
||||||
char *user; /* Generic username */
|
char *user; /* Generic username */
|
||||||
char *passwd; /* Generic password */
|
char *passwd; /* Generic password */
|
||||||
bool ask_passwd; /* Ask for password? */
|
bool ask_passwd; /* Ask for password? */
|
||||||
|
|
||||||
bool always_rest; /* Always use REST. */
|
bool always_rest; /* Always use REST. */
|
||||||
wgint start_pos; /* Start position of a download. */
|
wgint start_pos; /* Start position of a download. */
|
||||||
char *ftp_user; /* FTP username */
|
char *ftp_user; /* FTP username */
|
||||||
char *ftp_passwd; /* FTP password */
|
char *ftp_passwd; /* FTP password */
|
||||||
bool netrc; /* Whether to read .netrc. */
|
bool netrc; /* Whether to read .netrc. */
|
||||||
bool ftp_glob; /* FTP globbing */
|
bool ftp_glob; /* FTP globbing */
|
||||||
bool ftp_pasv; /* Passive FTP. */
|
bool ftp_pasv; /* Passive FTP. */
|
||||||
|
|
||||||
char *http_user; /* HTTP username. */
|
char *http_user; /* HTTP username. */
|
||||||
char *http_passwd; /* HTTP password. */
|
char *http_passwd; /* HTTP password. */
|
||||||
char **user_headers; /* User-defined header(s). */
|
char **user_headers; /* User-defined header(s). */
|
||||||
bool http_keep_alive; /* whether we use keep-alive */
|
bool http_keep_alive; /* whether we use keep-alive */
|
||||||
|
|
||||||
bool use_proxy; /* Do we use proxy? */
|
bool use_proxy; /* Do we use proxy? */
|
||||||
bool allow_cache; /* Do we allow server-side caching? */
|
bool allow_cache; /* Do we allow server-side caching? */
|
||||||
char *http_proxy, *ftp_proxy, *https_proxy;
|
char *http_proxy, *ftp_proxy, *https_proxy;
|
||||||
char **no_proxy;
|
char **no_proxy;
|
||||||
char *base_href;
|
char *base_href;
|
||||||
char *progress_type; /* progress indicator type. */
|
char *progress_type; /* progress indicator type. */
|
||||||
bool show_progress; /* Show only the progress bar */
|
bool show_progress; /* Show only the progress bar */
|
||||||
bool noscroll; /* Don't scroll the filename in the progressbar */
|
bool noscroll; /* Don't scroll the filename in the progressbar */
|
||||||
char *proxy_user; /*oli*/
|
char *proxy_user; /*oli*/
|
||||||
char *proxy_passwd;
|
char *proxy_passwd;
|
||||||
|
|
||||||
double read_timeout; /* The read/write timeout. */
|
double read_timeout; /* The read/write timeout. */
|
||||||
double dns_timeout; /* The DNS timeout. */
|
double dns_timeout; /* The DNS timeout. */
|
||||||
double connect_timeout; /* The connect timeout. */
|
double connect_timeout; /* The connect timeout. */
|
||||||
|
|
||||||
bool random_wait; /* vary from 0 .. wait secs by random()? */
|
bool random_wait; /* vary from 0 .. wait secs by random()? */
|
||||||
double wait; /* The wait period between retrievals. */
|
double wait; /* The wait period between retrievals. */
|
||||||
double waitretry; /* The wait period between retries. - HEH */
|
double waitretry; /* The wait period between retries. - HEH */
|
||||||
bool use_robots; /* Do we heed robots.txt? */
|
bool use_robots; /* Do we heed robots.txt? */
|
||||||
|
|
||||||
wgint limit_rate; /* Limit the download rate to this
|
wgint limit_rate; /* Limit the download rate to this
|
||||||
many bps. */
|
many bps. */
|
||||||
SUM_SIZE_INT quota; /* Maximum file size to download and
|
SUM_SIZE_INT quota; /* Maximum file size to download and
|
||||||
store. */
|
store. */
|
||||||
|
|
||||||
bool server_response; /* Do we print server response? */
|
bool server_response; /* Do we print server response? */
|
||||||
bool save_headers; /* Do we save headers together with
|
bool save_headers; /* Do we save headers together with
|
||||||
file? */
|
file? */
|
||||||
bool content_on_error; /* Do we output the content when the HTTP
|
bool content_on_error; /* Do we output the content when the HTTP
|
||||||
status code indicates a server error */
|
status code indicates a server error */
|
||||||
|
|
||||||
bool debug; /* Debugging on/off */
|
bool debug; /* Debugging on/off */
|
||||||
|
|
||||||
#ifdef USE_WATT32
|
#ifdef USE_WATT32
|
||||||
bool wdebug; /* Watt-32 tcp/ip debugging on/off */
|
bool wdebug; /* Watt-32 tcp/ip debugging on/off */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool timestamping; /* Whether to use time-stamping. */
|
bool timestamping; /* Whether to use time-stamping. */
|
||||||
|
|
||||||
bool backup_converted; /* Do we save pre-converted files as *.orig? */
|
bool backup_converted; /* Do we save pre-converted files as *.orig? */
|
||||||
int backups; /* Are numeric backups made? */
|
int backups; /* Are numeric backups made? */
|
||||||
|
|
||||||
char *useragent; /* User-Agent string, which can be set
|
char *useragent; /* User-Agent string, which can be set
|
||||||
to something other than Wget. */
|
to something other than Wget. */
|
||||||
char *referer; /* Naughty Referer, which can be
|
char *referer; /* Naughty Referer, which can be
|
||||||
set to something other than
|
set to something other than
|
||||||
NULL. */
|
NULL. */
|
||||||
bool convert_links; /* Will the links be converted
|
bool convert_links; /* Will the links be converted
|
||||||
locally? */
|
locally? */
|
||||||
bool remove_listing; /* Do we remove .listing files
|
bool remove_listing; /* Do we remove .listing files
|
||||||
generated by FTP? */
|
generated by FTP? */
|
||||||
bool htmlify; /* Do we HTML-ify the OS-dependent
|
bool htmlify; /* Do we HTML-ify the OS-dependent
|
||||||
listings? */
|
listings? */
|
||||||
|
|
||||||
char *dot_style;
|
char *dot_style;
|
||||||
wgint dot_bytes; /* How many bytes in a printing
|
wgint dot_bytes; /* How many bytes in a printing
|
||||||
dot. */
|
dot. */
|
||||||
int dots_in_line; /* How many dots in one line. */
|
int dots_in_line; /* How many dots in one line. */
|
||||||
int dot_spacing; /* How many dots between spacings. */
|
int dot_spacing; /* How many dots between spacings. */
|
||||||
|
|
||||||
bool delete_after; /* Whether the files will be deleted
|
bool delete_after; /* Whether the files will be deleted
|
||||||
after download. */
|
after download. */
|
||||||
|
|
||||||
bool adjust_extension; /* Use ".html" extension on all text/html? */
|
bool adjust_extension; /* Use ".html" extension on all text/html? */
|
||||||
|
|
||||||
bool page_requisites; /* Whether we need to download all files
|
bool page_requisites; /* Whether we need to download all files
|
||||||
necessary to display a page properly. */
|
necessary to display a page properly. */
|
||||||
char *bind_address; /* What local IP address to bind to. */
|
char *bind_address; /* What local IP address to bind to. */
|
||||||
|
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
enum {
|
enum {
|
||||||
@ -204,33 +203,33 @@ struct options
|
|||||||
secure_protocol_sslv3,
|
secure_protocol_sslv3,
|
||||||
secure_protocol_tlsv1,
|
secure_protocol_tlsv1,
|
||||||
secure_protocol_pfs
|
secure_protocol_pfs
|
||||||
} secure_protocol; /* type of secure protocol to use. */
|
} secure_protocol; /* type of secure protocol to use. */
|
||||||
bool check_cert; /* whether to validate the server's cert */
|
bool check_cert; /* whether to validate the server's cert */
|
||||||
char *cert_file; /* external client certificate to use. */
|
char *cert_file; /* external client certificate to use. */
|
||||||
char *private_key; /* private key file (if not internal). */
|
char *private_key; /* private key file (if not internal). */
|
||||||
enum keyfile_type {
|
enum keyfile_type {
|
||||||
keyfile_pem,
|
keyfile_pem,
|
||||||
keyfile_asn1
|
keyfile_asn1
|
||||||
} cert_type; /* type of client certificate file */
|
} cert_type; /* type of client certificate file */
|
||||||
enum keyfile_type
|
enum keyfile_type
|
||||||
private_key_type; /* type of private key file */
|
private_key_type; /* type of private key file */
|
||||||
|
|
||||||
char *ca_directory; /* CA directory (hash files) */
|
char *ca_directory; /* CA directory (hash files) */
|
||||||
char *ca_cert; /* CA certificate file to use */
|
char *ca_cert; /* CA certificate file to use */
|
||||||
|
|
||||||
char *random_file; /* file with random data to seed the PRNG */
|
char *random_file; /* file with random data to seed the PRNG */
|
||||||
char *egd_file; /* file name of the egd daemon socket */
|
char *egd_file; /* file name of the egd daemon socket */
|
||||||
bool https_only; /* whether to follow HTTPS only */
|
bool https_only; /* whether to follow HTTPS only */
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
|
|
||||||
bool cookies; /* whether cookies are used. */
|
bool cookies; /* whether cookies are used. */
|
||||||
char *cookies_input; /* file we're loading the cookies from. */
|
char *cookies_input; /* file we're loading the cookies from. */
|
||||||
char *cookies_output; /* file we're saving the cookies to. */
|
char *cookies_output; /* file we're saving the cookies to. */
|
||||||
bool keep_session_cookies; /* whether session cookies should be
|
bool keep_session_cookies; /* whether session cookies should be
|
||||||
saved and loaded. */
|
saved and loaded. */
|
||||||
|
|
||||||
char *post_data; /* POST query string */
|
char *post_data; /* POST query string */
|
||||||
char *post_file_name; /* File to post */
|
char *post_file_name; /* File to post */
|
||||||
char *method; /* HTTP Method to use in Header */
|
char *method; /* HTTP Method to use in Header */
|
||||||
char *body_data; /* HTTP Method Data String */
|
char *body_data; /* HTTP Method Data String */
|
||||||
char *body_file; /* HTTP Method File */
|
char *body_file; /* HTTP Method File */
|
||||||
@ -238,36 +237,36 @@ struct options
|
|||||||
enum {
|
enum {
|
||||||
restrict_unix,
|
restrict_unix,
|
||||||
restrict_windows
|
restrict_windows
|
||||||
} restrict_files_os; /* file name restriction ruleset. */
|
} restrict_files_os; /* file name restriction ruleset. */
|
||||||
bool restrict_files_ctrl; /* non-zero if control chars in URLs
|
bool restrict_files_ctrl; /* non-zero if control chars in URLs
|
||||||
are restricted from appearing in
|
are restricted from appearing in
|
||||||
generated file names. */
|
generated file names. */
|
||||||
bool restrict_files_nonascii; /* non-zero if bytes with values greater
|
bool restrict_files_nonascii; /* non-zero if bytes with values greater
|
||||||
than 127 are restricted. */
|
than 127 are restricted. */
|
||||||
enum {
|
enum {
|
||||||
restrict_no_case_restriction,
|
restrict_no_case_restriction,
|
||||||
restrict_lowercase,
|
restrict_lowercase,
|
||||||
restrict_uppercase
|
restrict_uppercase
|
||||||
} restrict_files_case; /* file name case restriction. */
|
} restrict_files_case; /* file name case restriction. */
|
||||||
|
|
||||||
bool strict_comments; /* whether strict SGML comments are
|
bool strict_comments; /* whether strict SGML comments are
|
||||||
enforced. */
|
enforced. */
|
||||||
|
|
||||||
bool preserve_perm; /* whether remote permissions are used
|
bool preserve_perm; /* whether remote permissions are used
|
||||||
or that what is set by umask. */
|
or that what is set by umask. */
|
||||||
|
|
||||||
#ifdef ENABLE_IPV6
|
#ifdef ENABLE_IPV6
|
||||||
bool ipv4_only; /* IPv4 connections have been requested. */
|
bool ipv4_only; /* IPv4 connections have been requested. */
|
||||||
bool ipv6_only; /* IPv4 connections have been requested. */
|
bool ipv6_only; /* IPv4 connections have been requested. */
|
||||||
#endif
|
#endif
|
||||||
enum {
|
enum {
|
||||||
prefer_ipv4,
|
prefer_ipv4,
|
||||||
prefer_ipv6,
|
prefer_ipv6,
|
||||||
prefer_none
|
prefer_none
|
||||||
} prefer_family; /* preferred address family when more
|
} prefer_family; /* preferred address family when more
|
||||||
than one type is available */
|
than one type is available */
|
||||||
|
|
||||||
bool content_disposition; /* Honor HTTP Content-Disposition header. */
|
bool content_disposition; /* Honor HTTP Content-Disposition header. */
|
||||||
bool auth_without_challenge; /* Issue Basic authentication creds without
|
bool auth_without_challenge; /* Issue Basic authentication creds without
|
||||||
waiting for a challenge. */
|
waiting for a challenge. */
|
||||||
|
|
||||||
@ -280,11 +279,11 @@ struct options
|
|||||||
int ftp_stmlf; /* Force Stream_LF format for binary FTP. */
|
int ftp_stmlf; /* Force Stream_LF format for binary FTP. */
|
||||||
#endif /* def __VMS */
|
#endif /* def __VMS */
|
||||||
|
|
||||||
bool useservertimestamps; /* Update downloaded files' timestamps to
|
bool useservertimestamps; /* Update downloaded files' timestamps to
|
||||||
match those on server? */
|
match those on server? */
|
||||||
|
|
||||||
bool show_all_dns_entries; /* Show all the DNS entries when resolving a
|
bool show_all_dns_entries; /* Show all the DNS entries when resolving a
|
||||||
name. */
|
name. */
|
||||||
bool report_bps; /*Output bandwidth in bits format*/
|
bool report_bps; /*Output bandwidth in bits format*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ as that of the covered work. */
|
|||||||
#ifndef PTIMER_H
|
#ifndef PTIMER_H
|
||||||
#define PTIMER_H
|
#define PTIMER_H
|
||||||
|
|
||||||
struct ptimer; /* forward declaration; all struct
|
struct ptimer; /* forward declaration; all struct
|
||||||
members are private */
|
members are private */
|
||||||
|
|
||||||
struct ptimer *ptimer_new (void);
|
struct ptimer *ptimer_new (void);
|
||||||
|
22
src/recur.c
22
src/recur.c
@ -253,23 +253,23 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
|
|||||||
the second time. */
|
the second time. */
|
||||||
if (dl_url_file_map && hash_table_contains (dl_url_file_map, url))
|
if (dl_url_file_map && hash_table_contains (dl_url_file_map, url))
|
||||||
{
|
{
|
||||||
bool is_css_bool;
|
bool is_css_bool;
|
||||||
|
|
||||||
file = xstrdup (hash_table_get (dl_url_file_map, url));
|
file = xstrdup (hash_table_get (dl_url_file_map, url));
|
||||||
|
|
||||||
DEBUGP (("Already downloaded \"%s\", reusing it from \"%s\".\n",
|
DEBUGP (("Already downloaded \"%s\", reusing it from \"%s\".\n",
|
||||||
url, file));
|
url, file));
|
||||||
|
|
||||||
if ((is_css_bool = (css_allowed
|
if ((is_css_bool = (css_allowed
|
||||||
&& downloaded_css_set
|
&& downloaded_css_set
|
||||||
&& string_set_contains (downloaded_css_set, file)))
|
&& string_set_contains (downloaded_css_set, file)))
|
||||||
|| (html_allowed
|
|| (html_allowed
|
||||||
&& downloaded_html_set
|
&& downloaded_html_set
|
||||||
&& string_set_contains (downloaded_html_set, file)))
|
&& string_set_contains (downloaded_html_set, file)))
|
||||||
{
|
{
|
||||||
descend = true;
|
descend = true;
|
||||||
is_css = is_css_bool;
|
is_css = is_css_bool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
12
src/retr.c
12
src/retr.c
@ -650,7 +650,7 @@ calc_rate (wgint bytes, double secs, int *units)
|
|||||||
{
|
{
|
||||||
double dlrate;
|
double dlrate;
|
||||||
double bibyte = 1000.0;
|
double bibyte = 1000.0;
|
||||||
|
|
||||||
if (!opt.report_bps)
|
if (!opt.report_bps)
|
||||||
bibyte = 1024.0;
|
bibyte = 1024.0;
|
||||||
|
|
||||||
@ -903,10 +903,10 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
|
|||||||
index page; that redirection is clearly a GET. We "suspend"
|
index page; that redirection is clearly a GET. We "suspend"
|
||||||
POST data for the duration of the redirections, and restore
|
POST data for the duration of the redirections, and restore
|
||||||
it when we're done.
|
it when we're done.
|
||||||
|
|
||||||
RFC2616 HTTP/1.1 introduces code 307 Temporary Redirect
|
RFC2616 HTTP/1.1 introduces code 307 Temporary Redirect
|
||||||
specifically to preserve the method of the request.
|
specifically to preserve the method of the request.
|
||||||
*/
|
*/
|
||||||
if (result != NEWLOCATION_KEEP_POST && !method_suspended)
|
if (result != NEWLOCATION_KEEP_POST && !method_suspended)
|
||||||
SUSPEND_METHOD;
|
SUSPEND_METHOD;
|
||||||
|
|
||||||
@ -1030,7 +1030,7 @@ retrieve_from_file (const char *file, bool html, int *count)
|
|||||||
/* If we have a found a content encoding, use it.
|
/* If we have a found a content encoding, use it.
|
||||||
* ( == is okay, because we're checking for identical object) */
|
* ( == is okay, because we're checking for identical object) */
|
||||||
if (iri->content_encoding != opt.locale)
|
if (iri->content_encoding != opt.locale)
|
||||||
set_uri_encoding (iri, iri->content_encoding, false);
|
set_uri_encoding (iri, iri->content_encoding, false);
|
||||||
|
|
||||||
/* Reset UTF-8 encode status */
|
/* Reset UTF-8 encode status */
|
||||||
iri->utf8_encode = opt.enable_iri;
|
iri->utf8_encode = opt.enable_iri;
|
||||||
|
@ -222,10 +222,10 @@ int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
|
|||||||
# undef FNM_PERIOD
|
# undef FNM_PERIOD
|
||||||
# undef FNM_NOMATCH
|
# undef FNM_NOMATCH
|
||||||
|
|
||||||
# define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
|
# define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
|
||||||
# define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
# define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||||
# define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
# define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||||
# define FNM_NOMATCH 1
|
# define FNM_NOMATCH 1
|
||||||
|
|
||||||
int fnmatch (const char *, const char *, int);
|
int fnmatch (const char *, const char *, int);
|
||||||
#endif
|
#endif
|
||||||
|
@ -76,11 +76,11 @@ enum url_scheme {
|
|||||||
/* Structure containing info on a URL. */
|
/* Structure containing info on a URL. */
|
||||||
struct url
|
struct url
|
||||||
{
|
{
|
||||||
char *url; /* Original URL */
|
char *url; /* Original URL */
|
||||||
enum url_scheme scheme; /* URL scheme */
|
enum url_scheme scheme; /* URL scheme */
|
||||||
|
|
||||||
char *host; /* Extracted hostname */
|
char *host; /* Extracted hostname */
|
||||||
int port; /* Port number */
|
int port; /* Port number */
|
||||||
|
|
||||||
/* URL components (URL-quoted). */
|
/* URL components (URL-quoted). */
|
||||||
char *path;
|
char *path;
|
||||||
|
10
src/vms.c
10
src/vms.c
@ -45,7 +45,7 @@
|
|||||||
*
|
*
|
||||||
* Simplifies a fancy URL-derived file name into an ODS2- or
|
* Simplifies a fancy URL-derived file name into an ODS2- or
|
||||||
* ODS5-compatible file name.
|
* ODS5-compatible file name.
|
||||||
*
|
*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* utime()
|
* utime()
|
||||||
@ -299,7 +299,7 @@ int dmy_lib$initialize = (int) lib$initialize;
|
|||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
/* vms_arch()
|
/* vms_arch()
|
||||||
|
|
||||||
Returns (run-time) VMS architecture string.
|
Returns (run-time) VMS architecture string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -556,12 +556,12 @@ char *vms_getpass( const char *prompt)
|
|||||||
fclose( sdc);
|
fclose( sdc);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
/* vms_vers()
|
/* vms_vers()
|
||||||
|
|
||||||
Returns (run-time) VMS version string.
|
Returns (run-time) VMS version string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1337,7 +1337,7 @@ localtime_r (t, tp)
|
|||||||
return tp;
|
return tp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __CRTL_VER < 70000000 */
|
#endif /* __CRTL_VER < 70000000 */
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -726,7 +726,7 @@ warc_start_new_file (bool meta)
|
|||||||
|
|
||||||
if (warc_current_file != NULL)
|
if (warc_current_file != NULL)
|
||||||
fclose (warc_current_file);
|
fclose (warc_current_file);
|
||||||
|
|
||||||
free (warc_current_warcinfo_uuid_str);
|
free (warc_current_warcinfo_uuid_str);
|
||||||
free (warc_current_filename);
|
free (warc_current_filename);
|
||||||
|
|
||||||
|
66
src/wget.h
66
src/wget.h
@ -254,24 +254,24 @@ typedef double SUM_SIZE_INT;
|
|||||||
/* Copy the data delimited with BEG and END to alloca-allocated
|
/* Copy the data delimited with BEG and END to alloca-allocated
|
||||||
storage, and zero-terminate it. Arguments are evaluated only once,
|
storage, and zero-terminate it. Arguments are evaluated only once,
|
||||||
in the order BEG, END, PLACE. */
|
in the order BEG, END, PLACE. */
|
||||||
#define BOUNDED_TO_ALLOCA(beg, end, place) do { \
|
#define BOUNDED_TO_ALLOCA(beg, end, place) do { \
|
||||||
const char *BTA_beg = (beg); \
|
const char *BTA_beg = (beg); \
|
||||||
int BTA_len = (end) - BTA_beg; \
|
int BTA_len = (end) - BTA_beg; \
|
||||||
char **BTA_dest = &(place); \
|
char **BTA_dest = &(place); \
|
||||||
*BTA_dest = alloca (BTA_len + 1); \
|
*BTA_dest = alloca (BTA_len + 1); \
|
||||||
memcpy (*BTA_dest, BTA_beg, BTA_len); \
|
memcpy (*BTA_dest, BTA_beg, BTA_len); \
|
||||||
(*BTA_dest)[BTA_len] = '\0'; \
|
(*BTA_dest)[BTA_len] = '\0'; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* Return non-zero if string bounded between BEG and END is equal to
|
/* Return non-zero if string bounded between BEG and END is equal to
|
||||||
STRING_LITERAL. The comparison is case-sensitive. */
|
STRING_LITERAL. The comparison is case-sensitive. */
|
||||||
#define BOUNDED_EQUAL(beg, end, string_literal) \
|
#define BOUNDED_EQUAL(beg, end, string_literal) \
|
||||||
((end) - (beg) == sizeof (string_literal) - 1 \
|
((end) - (beg) == sizeof (string_literal) - 1 \
|
||||||
&& !memcmp (beg, string_literal, sizeof (string_literal) - 1))
|
&& !memcmp (beg, string_literal, sizeof (string_literal) - 1))
|
||||||
|
|
||||||
/* The same as above, except the comparison is case-insensitive. */
|
/* The same as above, except the comparison is case-insensitive. */
|
||||||
#define BOUNDED_EQUAL_NO_CASE(beg, end, string_literal) \
|
#define BOUNDED_EQUAL_NO_CASE(beg, end, string_literal) \
|
||||||
((end) - (beg) == sizeof (string_literal) - 1 \
|
((end) - (beg) == sizeof (string_literal) - 1 \
|
||||||
&& !strncasecmp (beg, string_literal, sizeof (string_literal) - 1))
|
&& !strncasecmp (beg, string_literal, sizeof (string_literal) - 1))
|
||||||
|
|
||||||
/* Like ptr=strdup(str), but allocates the space for PTR on the stack.
|
/* Like ptr=strdup(str), but allocates the space for PTR on the stack.
|
||||||
@ -280,11 +280,11 @@ typedef double SUM_SIZE_INT;
|
|||||||
The problem is that some compilers can't handle alloca() being an
|
The problem is that some compilers can't handle alloca() being an
|
||||||
argument to a function. */
|
argument to a function. */
|
||||||
|
|
||||||
#define STRDUP_ALLOCA(ptr, str) do { \
|
#define STRDUP_ALLOCA(ptr, str) do { \
|
||||||
char **SA_dest = &(ptr); \
|
char **SA_dest = &(ptr); \
|
||||||
const char *SA_src = (str); \
|
const char *SA_src = (str); \
|
||||||
*SA_dest = (char *)alloca (strlen (SA_src) + 1); \
|
*SA_dest = (char *)alloca (strlen (SA_src) + 1); \
|
||||||
strcpy (*SA_dest, SA_src); \
|
strcpy (*SA_dest, SA_src); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* Generally useful if you want to avoid arbitrary size limits but
|
/* Generally useful if you want to avoid arbitrary size limits but
|
||||||
@ -295,17 +295,17 @@ typedef double SUM_SIZE_INT;
|
|||||||
NEEDED_SIZE objects. The reallocing is done by doubling, which
|
NEEDED_SIZE objects. The reallocing is done by doubling, which
|
||||||
ensures constant amortized time per element. */
|
ensures constant amortized time per element. */
|
||||||
|
|
||||||
#define DO_REALLOC(basevar, sizevar, needed_size, type) do { \
|
#define DO_REALLOC(basevar, sizevar, needed_size, type) do { \
|
||||||
long DR_needed_size = (needed_size); \
|
long DR_needed_size = (needed_size); \
|
||||||
long DR_newsize = 0; \
|
long DR_newsize = 0; \
|
||||||
while ((sizevar) < (DR_needed_size)) { \
|
while ((sizevar) < (DR_needed_size)) { \
|
||||||
DR_newsize = sizevar << 1; \
|
DR_newsize = sizevar << 1; \
|
||||||
if (DR_newsize < 16) \
|
if (DR_newsize < 16) \
|
||||||
DR_newsize = 16; \
|
DR_newsize = 16; \
|
||||||
(sizevar) = DR_newsize; \
|
(sizevar) = DR_newsize; \
|
||||||
} \
|
} \
|
||||||
if (DR_newsize) \
|
if (DR_newsize) \
|
||||||
basevar = xrealloc (basevar, DR_newsize * sizeof (type)); \
|
basevar = xrealloc (basevar, DR_newsize * sizeof (type)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* Used to print pointers (usually for debugging). Print pointers
|
/* Used to print pointers (usually for debugging). Print pointers
|
||||||
@ -323,14 +323,14 @@ extern const char *exec_name;
|
|||||||
/* Document type ("dt") flags */
|
/* Document type ("dt") flags */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TEXTHTML = 0x0001, /* document is of type text/html
|
TEXTHTML = 0x0001, /* document is of type text/html
|
||||||
or application/xhtml+xml */
|
or application/xhtml+xml */
|
||||||
RETROKF = 0x0002, /* retrieval was OK */
|
RETROKF = 0x0002, /* retrieval was OK */
|
||||||
HEAD_ONLY = 0x0004, /* only send the HEAD request */
|
HEAD_ONLY = 0x0004, /* only send the HEAD request */
|
||||||
SEND_NOCACHE = 0x0008, /* send Pragma: no-cache directive */
|
SEND_NOCACHE = 0x0008, /* send Pragma: no-cache directive */
|
||||||
ACCEPTRANGES = 0x0010, /* Accept-ranges header was found */
|
ACCEPTRANGES = 0x0010, /* Accept-ranges header was found */
|
||||||
ADDED_HTML_EXTENSION = 0x0020, /* added ".html" extension due to -E */
|
ADDED_HTML_EXTENSION = 0x0020, /* added ".html" extension due to -E */
|
||||||
TEXTCSS = 0x0040 /* document is of type text/css */
|
TEXTCSS = 0x0040 /* document is of type text/css */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Universal error type -- used almost everywhere. Error reporting of
|
/* Universal error type -- used almost everywhere. Error reporting of
|
||||||
|
Loading…
Reference in New Issue
Block a user