#include "hash.h"
#include "convert.h"
#include "ptimer.h"
-#include "iri.h"
#include "html-url.h"
/* Total size of downloaded files. Used to enforce quota. */
u = url_parse (url, &up_error_code, iri);
if (!u)
{
- logprintf (LOG_NOTQUIET, "%s: %s.\n", url, url_error (up_error_code));
+ char *error = url_error (url, up_error_code);
+ logprintf (LOG_NOTQUIET, "%s: %s.\n", url, error);
xfree (url);
+ xfree (error);
return URLERROR;
}
DEBUGP (("[IRI Retrieving %s with %s (UTF-8=%d)\n", quote (url),
- quote (iri->uri_encoding), iri->utf8_encode));
+ iri->uri_encoding ? quote (iri->uri_encoding) : "None",
+ iri->utf8_encode));
if (!refurl)
refurl = opt.referer;
{
/* sXXXav : could a proxy include a path ??? */
struct iri *pi = iri_new ();
- set_uri_encoding (pi, opt.locale);
+ set_uri_encoding (pi, opt.locale, true);
pi->utf8_encode = false;
/* Parse the proxy URL. */
proxy_url = url_parse (proxy, &up_error_code, NULL);
if (!proxy_url)
{
+ char *error = url_error (proxy, up_error_code);
logprintf (LOG_NOTQUIET, _("Error parsing proxy URL %s: %s.\n"),
- proxy, url_error (up_error_code));
+ proxy, error);
xfree (url);
+ xfree (error);
RESTORE_POST_DATA;
return PROXERR;
}
newloc_parsed = url_parse (mynewloc, &up_error_code, iri);
if (!newloc_parsed)
{
+ char *error = url_error (mynewloc, up_error_code);
logprintf (LOG_NOTQUIET, "%s: %s.\n", escnonprint_uri (mynewloc),
- url_error (up_error_code));
+ error);
url_free (u);
xfree (url);
xfree (mynewloc);
+ xfree (error);
RESTORE_POST_DATA;
return result;
}
struct url *u;
struct iri *i = iri_new();
/* url was given in the command line, so use locale as encoding */
- set_uri_encoding (i, opt.locale);
+ set_uri_encoding (i, opt.locale, true);
u= url_parse (url, NULL, i);
if (!u)
return false;