Published in <sxs8zl5v5cw.fsf@florida.arsdigita.de>.
+2001-04-13 Hrvoje Niksic <hniksic@arsdigita.com>
+
+ * init.c: Include cookies.h.
+
+ * cookies.h: Declare cookies_cleanup.
+
+ * cookies.c (check_domain_match): Remove unused variable.
+ (save_cookies): Remove extraneous argument from debug statement.
+
+ * host.c (same_host): Don't call skip_url.
+
+ * url.c (skip_url): Removed. Removed its calls from various
+ functions in url.c.
+
2001-04-13 Hrvoje Niksic <hniksic@arsdigita.com>
* cookies.c (unsigned_string_hash): Use the new code in
2001-04-13 Hrvoje Niksic <hniksic@arsdigita.com>
* cookies.c (unsigned_string_hash): Use the new code in
static int
check_domain_match (const char *cookie_domain, const char *host)
{
static int
check_domain_match (const char *cookie_domain, const char *host)
{
const char *tail;
/* Numeric address requires exact match. It also requires HOST to
const char *tail;
/* Numeric address requires exact match. It also requires HOST to
logprintf (LOG_NOTQUIET, _("Error closing `%s': %s\n"),
file, strerror (errno));
logprintf (LOG_NOTQUIET, _("Error closing `%s': %s\n"),
file, strerror (errno));
- DEBUGP (("Done saving cookies.\n", file));
+ DEBUGP (("Done saving cookies.\n"));
void load_cookies PARAMS ((const char *));
void save_cookies PARAMS ((const char *));
void load_cookies PARAMS ((const char *));
void save_cookies PARAMS ((const char *));
+
+void cookies_cleanup PARAMS ((void));
int hour, min, sec;
struct tm timestruct;
int hour, min, sec;
struct tm timestruct;
- char *line, *tok, *p; /* tokenizer */
+ char *line, *tok; /* tokenizer */
struct fileinfo *dir, *l, cur; /* list creation */
fp = fopen (file, "rb");
struct fileinfo *dir, *l, cur; /* list creation */
fp = fopen (file, "rb");
char *real1, *real2;
/* Skip protocol, if present. */
char *real1, *real2;
/* Skip protocol, if present. */
- u1 += skip_url (u1);
- u2 += skip_url (u2);
u1 += skip_proto (u1);
u2 += skip_proto (u2);
u1 += skip_proto (u1);
u2 += skip_proto (u2);
#include "host.h"
#include "recur.h"
#include "netrc.h"
#include "host.h"
#include "recur.h"
#include "netrc.h"
+#include "cookies.h" /* for cookies_cleanup */
#ifndef errno
extern int errno;
#ifndef errno
extern int errno;
#endif
static int urlpath_length PARAMS ((const char *));
#endif
static int urlpath_length PARAMS ((const char *));
-/* NULL-terminated list of strings to be recognized as prototypes (URL
- schemes). Note that recognized doesn't mean supported -- only HTTP,
- HTTPS and FTP are currently supported .
+/* A NULL-terminated list of strings to be recognized as prototypes
+ (URL schemes). Note that recognized doesn't mean supported -- only
+ HTTP, HTTPS and FTP are currently supported .
However, a string that does not match anything in the list will be
considered a relative URL. Thus it's important that this list has
However, a string that does not match anything in the list will be
considered a relative URL. Thus it's important that this list has
#ifdef HAVE_SSL
{ "https://",URLHTTPS, DEFAULT_HTTPS_PORT},
#endif
#ifdef HAVE_SSL
{ "https://",URLHTTPS, DEFAULT_HTTPS_PORT},
#endif
- { "ftp://", URLFTP, DEFAULT_FTP_PORT },
- /*{ "file://", URLFILE, DEFAULT_FTP_PORT },*/
+ { "ftp://", URLFTP, DEFAULT_FTP_PORT }
};
static void parse_dir PARAMS ((const char *, char **, char **));
};
static void parse_dir PARAMS ((const char *, char **, char **));
static char process_ftp_type PARAMS ((char *));
\f
static char process_ftp_type PARAMS ((char *));
\f
-/* Returns the number of characters to be skipped if the first thing
- in a URL is URL: (which is 0 or 4+). The optional spaces after
- URL: are also skipped. */
-int
-skip_url (const char *url)
-{
- int i;
-
- if (TOUPPER (url[0]) == 'U'
- && TOUPPER (url[1]) == 'R'
- && TOUPPER (url[2]) == 'L'
- && url[3] == ':')
- {
- /* Skip blanks. */
- for (i = 4; url[i] && ISSPACE (url[i]); i++);
- return i;
- }
- else
- return 0;
-}
-
/* Unsafe chars:
- anything <= 32;
- stuff from rfc1738 ("<>\"#%{}|\\^~[]`");
/* Unsafe chars:
- anything <= 32;
- stuff from rfc1738 ("<>\"#%{}|\\^~[]`");
for (i = 0; i < ARRAY_SIZE (sup_protos); i++)
if (!strncasecmp (url, sup_protos[i].name, strlen (sup_protos[i].name)))
return sup_protos[i].ind;
for (i = 0; i < ARRAY_SIZE (sup_protos); i++)
if (!strncasecmp (url, sup_protos[i].name, strlen (sup_protos[i].name)))
return sup_protos[i].ind;
for (s = protostrings; *s; s++)
if (strncasecmp (url, *s, strlen (*s)) == 0)
return 1;
for (s = protostrings; *s; s++)
if (strncasecmp (url, *s, strlen (*s)) == 0)
return 1;
uerr_t type;
DEBUGP (("parseurl (\"%s\") -> ", url));
uerr_t type;
DEBUGP (("parseurl (\"%s\") -> ", url));
recognizable = has_proto (url);
if (strict && !recognizable)
return URLUNKNOWN;
recognizable = has_proto (url);
if (strict && !recognizable)
return URLUNKNOWN;
*user = NULL;
*passwd = NULL;
*user = NULL;
*passwd = NULL;
- url += skip_url (url);
- /* Look for end of protocol string. */
+
+ /* Look for the end of the protocol string. */
l = skip_proto (url);
if (!l)
return URLUNKNOWN;
l = skip_proto (url);
if (!l)
return URLUNKNOWN;
/* Function declarations */
/* Function declarations */
-int skip_url PARAMS ((const char *));
-
int contains_unsafe PARAMS ((const char *));
char *encode_string PARAMS ((const char *));
int contains_unsafe PARAMS ((const char *));
char *encode_string PARAMS ((const char *));