static void
free_hstat (struct http_stat *hs)
{
- FREE_MAYBE (hs->newloc);
- FREE_MAYBE (hs->remote_time);
- FREE_MAYBE (hs->error);
+ xfree_null (hs->newloc);
+ xfree_null (hs->remote_time);
+ xfree_null (hs->error);
/* Guard against being called twice. */
hs->newloc = NULL;
DEBUGP (("---request begin---\n%s", request));
/* Free the temporary memory. */
- FREE_MAYBE (wwwauth);
- FREE_MAYBE (proxyauth);
- FREE_MAYBE (cookies);
+ xfree_null (wwwauth);
+ xfree_null (proxyauth);
+ xfree_null (cookies);
xfree (full_path);
/* Send the request to server. */
logputs (LOG_VERBOSE, "\n");
logputs (LOG_NOTQUIET, _("End of file while parsing headers.\n"));
xfree (hdr);
- FREE_MAYBE (type);
- FREE_MAYBE (all_headers);
+ xfree_null (type);
+ xfree_null (all_headers);
CLOSE_INVALIDATE (sock);
return HEOF;
}
logprintf (LOG_NOTQUIET, _("Read error (%s) in headers.\n"),
strerror (errno));
xfree (hdr);
- FREE_MAYBE (type);
- FREE_MAYBE (all_headers);
+ xfree_null (type);
+ xfree_null (all_headers);
CLOSE_INVALIDATE (sock);
return HERR;
}
&& authenticate_h)
{
/* Authorization is required. */
- FREE_MAYBE (type);
+ xfree_null (type);
type = NULL;
free_hstat (hs);
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
hs->newloc ? _(" [following]") : "");
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
- FREE_MAYBE (type);
- FREE_MAYBE (all_headers);
+ xfree_null (type);
+ xfree_null (all_headers);
return NEWLOCATION;
}
}
hs->res = 0;
/* Mark as successfully retrieved. */
*dt |= RETROKF;
- FREE_MAYBE (type);
- FREE_MAYBE (all_headers);
+ xfree_null (type);
+ xfree_null (all_headers);
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
return RETRUNNEEDED;
\n\
Continued download failed on this file, which conflicts with `-c'.\n\
Refusing to truncate existing file `%s'.\n\n"), *hs->local_file);
- FREE_MAYBE (type);
- FREE_MAYBE (all_headers);
+ xfree_null (type);
+ xfree_null (all_headers);
CLOSE_INVALIDATE (sock);
return CONTNOTSUPPORTED;
}
{
/* This means the whole request was somehow misunderstood by the
server. Bail out. */
- FREE_MAYBE (type);
- FREE_MAYBE (all_headers);
+ xfree_null (type);
+ xfree_null (all_headers);
CLOSE_INVALIDATE (sock);
return RANGEERR;
}
logputs (LOG_VERBOSE, "\n");
}
}
- FREE_MAYBE (type);
+ xfree_null (type);
type = NULL; /* We don't need it any more. */
/* Return if we have no intention of further downloading. */
/* In case the caller cares to look... */
hs->len = 0L;
hs->res = 0;
- FREE_MAYBE (type);
- FREE_MAYBE (all_headers);
+ xfree_null (type);
+ xfree_null (all_headers);
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
return RETRFINISHED;
logprintf (LOG_NOTQUIET, "%s: %s\n", *hs->local_file, strerror (errno));
CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there
might be more bytes in the body. */
- FREE_MAYBE (all_headers);
+ xfree_null (all_headers);
return FOPENERR;
}
}
if (flush_res == EOF)
hs->res = -2;
}
- FREE_MAYBE (all_headers);
+ xfree_null (all_headers);
if (hs->res == -2)
return FWRITEERR;
return RETRFINISHED;
if (has_html_suffix_p (*hstat.local_file))
*dt |= TEXTHTML;
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return RETROK;
}
use_ts = 0;
if (opt.timestamping)
{
- boolean local_dot_orig_file_exists = FALSE;
+ int local_dot_orig_file_exists = 0;
if (opt.backup_converted)
/* If -K is specified, we'll act on the assumption that it was specified
/* Try to stat() the .orig file. */
if (stat (filename_plus_orig_suffix, &st) == 0)
{
- local_dot_orig_file_exists = TRUE;
+ local_dot_orig_file_exists = 1;
local_filename = filename_plus_orig_suffix;
}
}
case SSLERRCTXCREATE: case CONTNOTSUPPORTED:
/* Fatal errors just return from the function. */
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return err;
break;
case FWRITEERR: case FOPENERR:
logprintf (LOG_NOTQUIET, _("Cannot write to `%s' (%s).\n"),
*hstat.local_file, strerror (errno));
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return err;
break;
case CONSSLERR:
logputs (LOG_VERBOSE, "\n");
logprintf (LOG_NOTQUIET, _("Unable to establish SSL connection.\n"));
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return err;
break;
case NEWLOCATION:
_("ERROR: Redirection (%d) without location.\n"),
hstat.statcode);
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return WRONGCODE;
}
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return NEWLOCATION;
break;
case RETRUNNEEDED:
/* The file was already fully retrieved. */
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return RETROK;
break;
case RETRFINISHED:
tms, hstat.statcode, hstat.error);
logputs (LOG_VERBOSE, "\n");
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return WRONGCODE;
}
Server file no newer than local file `%s' -- not retrieving.\n\n"),
local_filename);
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return RETROK;
}
else if (tml >= tmr)
if (opt.spider)
{
logprintf (LOG_NOTQUIET, "%d %s\n\n", hstat.statcode, hstat.error);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return RETROK;
}
downloaded_file(FILE_DOWNLOADED_NORMALLY, locf);
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return RETROK;
}
else if (hstat.res == 0) /* No read error */
downloaded_file(FILE_DOWNLOADED_NORMALLY, locf);
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return RETROK;
}
else if (hstat.len < hstat.contlen) /* meaning we lost the
downloaded_file(FILE_DOWNLOADED_NORMALLY, locf);
free_hstat (&hstat);
- FREE_MAYBE (dummy);
+ xfree_null (dummy);
return RETROK;
}
else /* the same, but not accepted */
;
if (!*ep)
return -1;
- FREE_MAYBE (*ret);
+ xfree_null (*ret);
*ret = strdupdelim (cp, ep);
return ep - au + 1;
}
options[i].variable);
if (skip < 0)
{
- FREE_MAYBE (realm);
- FREE_MAYBE (opaque);
- FREE_MAYBE (nonce);
+ xfree_null (realm);
+ xfree_null (opaque);
+ xfree_null (nonce);
return NULL;
}
else if (skip)
}
if (!realm || !nonce || !user || !passwd || !path || !method)
{
- FREE_MAYBE (realm);
- FREE_MAYBE (opaque);
- FREE_MAYBE (nonce);
+ xfree_null (realm);
+ xfree_null (opaque);
+ xfree_null (nonce);
return NULL;
}