Remove parent from fetches, clearing a todo from llcache.c

svn path=/trunk/netsurf/; revision=10299
This commit is contained in:
Daniel Silverstone 2010-04-08 11:47:05 +00:00
parent 6948496d45
commit 2b1146bcb3
3 changed files with 7 additions and 27 deletions

View File

@ -75,7 +75,6 @@ struct fetch {
char *referer; /**< Referer URL. */
bool send_referer; /**< Valid to send the referer */
bool verifiable; /**< Transaction is verifiable */
struct content *parent; /**< Parent content, or NULL */
void *p; /**< Private data for callback. */
char *host; /**< Host part of URL. */
long http_code; /**< HTTP response code, or 0. */
@ -213,8 +212,7 @@ struct fetch * fetch_start(const char *url, const char *referer,
fetch_callback callback,
void *p, bool only_2xx, const char *post_urlenc,
struct fetch_multipart_data *post_multipart,
bool verifiable, struct content *parent,
char *headers[])
bool verifiable, char *headers[])
{
char *host;
struct fetch *fetch;
@ -261,7 +259,6 @@ struct fetch * fetch_start(const char *url, const char *referer,
fetch->callback = callback;
fetch->url = strdup(url);
fetch->verifiable = verifiable;
fetch->parent = parent;
fetch->p = p;
fetch->host = host;
fetch->http_code = 0;
@ -571,19 +568,6 @@ const char *fetch_get_referer(struct fetch *fetch)
return fetch->referer;
}
/**
* Get the parent URL for this fetch
*
* \param fetch fetch to retrieve parent url from
* \return Pointer to parent content, or NULL if none.
*/
struct content *fetch_get_parent(struct fetch *fetch)
{
assert(fetch);
return fetch->parent;
}
/**
* Determine if a fetch was verifiable
*
@ -728,16 +712,14 @@ fetch_set_cookie(struct fetch *fetch, const char *data)
{
assert(fetch && data);
/* If the fetch is unverifiable and there's no parent content,
* err on the side of caution and do not set the cookie */
/* If the fetch is unverifiable err on the side of caution and
* do not set the cookie */
if (fetch->verifiable || fetch->parent) {
if (fetch->verifiable) {
/* If the transaction's verifiable, we don't require
* that the request uri and the parent domain match,
* so don't pass in the parent in this case. */
urldb_set_cookie(data, fetch->url,
fetch->verifiable ? NULL
: content_get_url(fetch->parent));
* so don't pass in any referer/parent in this case. */
urldb_set_cookie(data, fetch->url, NULL);
}
}

View File

@ -86,7 +86,7 @@ struct fetch * fetch_start(const char *url, const char *referer,
fetch_callback callback,
void *p, bool only_2xx, const char *post_urlenc,
struct fetch_multipart_data *post_multipart,
bool verifiable, struct content *parent,
bool verifiable,
char *headers[]);
void fetch_abort(struct fetch *f);
void fetch_poll(void);
@ -99,7 +99,6 @@ void fetch_change_callback(struct fetch *fetch,
void *p);
long fetch_http_code(struct fetch *fetch);
const char *fetch_get_referer(struct fetch *fetch);
struct content *fetch_get_parent(struct fetch *fetch);
bool fetch_get_verifiable(struct fetch *fetch);
void fetch_multipart_data_destroy(struct fetch_multipart_data *list);

View File

@ -892,7 +892,6 @@ nserror llcache_object_refetch(llcache_object *object)
object->fetch.flags & LLCACHE_RETRIEVE_NO_ERROR_PAGES,
urlenc, multipart,
object->fetch.flags & LLCACHE_RETRIEVE_VERIFIABLE,
NULL, /** \todo Remove parent from this API */
headers);
/* Clean up cache-control headers */