mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
[project @ 2004-06-23 15:41:50 by bursa]
Fix fetchcache_go() treatment of contents which the initiator loses interest in (eg. wrong content-type). svn path=/import/netsurf/; revision=997
This commit is contained in:
parent
ecc3e59fdc
commit
6720beb2c1
@ -626,6 +626,29 @@ void content_add_user(struct content *c,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Search the users of a content for the specified user.
|
||||
*
|
||||
* \return a content_user struct for the user, or 0 if not found
|
||||
*/
|
||||
|
||||
struct content_user * content_find_user(struct content *c,
|
||||
void (*callback)(content_msg msg, struct content *c, void *p1,
|
||||
void *p2, union content_msg_data data),
|
||||
void *p1, void *p2)
|
||||
{
|
||||
struct content_user *user;
|
||||
|
||||
/* user_list starts with a sentinel */
|
||||
for (user = c->user_list; user->next &&
|
||||
!(user->next->callback == callback &&
|
||||
user->next->p1 == p1 &&
|
||||
user->next->p2 == p2); user = user->next)
|
||||
;
|
||||
return user->next;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove a callback user.
|
||||
*
|
||||
@ -690,18 +713,12 @@ void content_stop(struct content *c,
|
||||
|
||||
assert(c->status == CONTENT_STATUS_READY);
|
||||
|
||||
/* user_list starts with a sentinel */
|
||||
for (user = c->user_list; user->next != 0 &&
|
||||
!(user->next->callback == callback &&
|
||||
user->next->p1 == p1 &&
|
||||
user->next->p2 == p2); user = user->next)
|
||||
;
|
||||
if (user->next == 0) {
|
||||
user = content_find_user(c, callback, p1, p2);
|
||||
if (!user) {
|
||||
LOG(("user not found in list"));
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
user = user->next;
|
||||
|
||||
LOG(("%p %s: stop user %p %p %p", c, c->url, callback, p1, p2));
|
||||
user->stop = true;
|
||||
|
@ -270,6 +270,10 @@ void content_add_user(struct content *c,
|
||||
void (*callback)(content_msg msg, struct content *c, void *p1,
|
||||
void *p2, union content_msg_data data),
|
||||
void *p1, void *p2);
|
||||
struct content_user * content_find_user(struct content *c,
|
||||
void (*callback)(content_msg msg, struct content *c, void *p1,
|
||||
void *p2, union content_msg_data data),
|
||||
void *p1, void *p2);
|
||||
void content_remove_user(struct content *c,
|
||||
void (*callback)(content_msg msg, struct content *c, void *p1,
|
||||
void *p2, union content_msg_data data),
|
||||
|
@ -172,12 +172,15 @@ void fetchcache_go(struct content *content, char *referer,
|
||||
|
||||
} else if (content->status == CONTENT_STATUS_READY) {
|
||||
callback(CONTENT_MSG_LOADING, content, p1, p2, msg_data);
|
||||
callback(CONTENT_MSG_READY, content, p1, p2, msg_data);
|
||||
if (content_find_user(content, callback, p1, p2))
|
||||
callback(CONTENT_MSG_READY, content, p1, p2, msg_data);
|
||||
|
||||
} else if (content->status == CONTENT_STATUS_DONE) {
|
||||
callback(CONTENT_MSG_LOADING, content, p1, p2, msg_data);
|
||||
callback(CONTENT_MSG_READY, content, p1, p2, msg_data);
|
||||
callback(CONTENT_MSG_DONE, content, p1, p2, msg_data);
|
||||
if (content_find_user(content, callback, p1, p2))
|
||||
callback(CONTENT_MSG_READY, content, p1, p2, msg_data);
|
||||
if (content_find_user(content, callback, p1, p2))
|
||||
callback(CONTENT_MSG_DONE, content, p1, p2, msg_data);
|
||||
|
||||
} else if (content->status == CONTENT_STATUS_ERROR) {
|
||||
/* shouldn't usually occur */
|
||||
|
Loading…
Reference in New Issue
Block a user