while (*hdr == ' ' || *hdr == '\t');
}
DO_REALLOC (resp->headers, size, count + 1, const char *);
- resp->headers[count++] = NULL;
+ resp->headers[count] = NULL;
return resp;
}
if (b < e && e[-1] == '\r')
--e;
BOUNDED_TO_ALLOCA (b, e, ln);
- logprintf (LOG_VERBOSE, "%s%s\n", prefix, ln);
+ logprintf (LOG_VERBOSE, "%s%s\n", prefix, escnonprint (ln));
}
/* Print the server response, line by line, omitting the trailing CR
int flags;
/* Whether authorization has been already tried. */
- int auth_tried_already = 0;
+ int auth_tried_already;
/* Whether our connection to the remote host is through SSL. */
int using_ssl = 0;
sock = pconn.socket;
using_ssl = pconn.ssl;
logprintf (LOG_VERBOSE, _("Reusing existing connection to %s:%d.\n"),
- pconn.host, pconn.port);
+ escnonprint (pconn.host), pconn.port);
DEBUGP (("Reusing fd %d.\n", sock));
}
}
{
failed_tunnel:
logprintf (LOG_NOTQUIET, _("Proxy tunneling failed: %s"),
- message ? message : "?");
+ message ? escnonprint (message) : "?");
xfree_null (message);
return CONSSLERR;
}
- xfree (message);
+ xfree_null (message);
/* SOCK is now *really* connected to u->host, so update CONN
to reflect this. That way register_persistent will
proxy ? "Proxy" : "HTTP");
contlen = -1;
contrange = 0;
- type = NULL;
- statcode = -1;
*dt &= ~RETROKF;
head = fd_read_http_head (sock);
message = NULL;
statcode = response_status (resp, &message);
if (!opt.server_response)
- logprintf (LOG_VERBOSE, "%2d %s\n", statcode, message ? message : "");
+ logprintf (LOG_VERBOSE, "%2d %s\n", statcode,
+ message ? escnonprint (message) : "");
else
{
logprintf (LOG_VERBOSE, "\n");
{
logprintf (LOG_VERBOSE,
_("Location: %s%s\n"),
- hs->newloc ? hs->newloc : _("unspecified"),
+ hs->newloc ? escnonprint_uri (hs->newloc) : _("unspecified"),
hs->newloc ? _(" [following]") : "");
if (keep_alive)
skip_short_body (sock, contlen);
logputs (LOG_VERBOSE,
opt.ignore_length ? _("ignored") : _("unspecified"));
if (type)
- logprintf (LOG_VERBOSE, " [%s]\n", type);
+ logprintf (LOG_VERBOSE, " [%s]\n", escnonprint (type));
else
logputs (LOG_VERBOSE, "\n");
}
xfree (hurl);
}
logprintf (LOG_NOTQUIET, _("%s ERROR %d: %s.\n"),
- tms, hstat.statcode, hstat.error);
+ tms, hstat.statcode, escnonprint (hstat.error));
logputs (LOG_VERBOSE, "\n");
free_hstat (&hstat);
xfree_null (dummy);
if (opt.spider)
{
- logprintf (LOG_NOTQUIET, "%d %s\n\n", hstat.statcode, hstat.error);
+ logprintf (LOG_NOTQUIET, "%d %s\n\n", hstat.statcode,
+ escnonprint (hstat.error));
xfree_null (dummy);
return RETROK;
}
static int
extract_header_attr (const char *au, const char *attr_name, char **ret)
{
- const char *cp, *ep;
-
- ep = cp = au;
+ const char *ep;
+ const char *cp = au;
if (strncmp (cp, attr_name, strlen (attr_name)) == 0)
{