summaryrefslogtreecommitdiff
path: root/content/fetch.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-06-17 19:24:21 +0000
committerJames Bursa <james@netsurf-browser.org>2003-06-17 19:24:21 +0000
commit0c0ff3c59631d0968c888279195ea40d4a7fd824 (patch)
treef94b64c20bc361664de61ef8993be7693ad2a08d /content/fetch.c
parentce6dbbb5db1d4ffe77ca99411ddb2d19694eff9c (diff)
downloadnetsurf-0c0ff3c59631d0968c888279195ea40d4a7fd824.tar.gz
netsurf-0c0ff3c59631d0968c888279195ea40d4a7fd824.tar.bz2
[project @ 2003-06-17 19:24:20 by bursa]
Change fetchcache system to store loading contents in cache. svn path=/import/netsurf/; revision=180
Diffstat (limited to 'content/fetch.c')
-rw-r--r--content/fetch.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/content/fetch.c b/content/fetch.c
index 3d1bdc817..65a0de988 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -1,5 +1,5 @@
/**
- * $Id: fetch.c,v 1.9 2003/06/02 01:09:50 jmb Exp $
+ * $Id: fetch.c,v 1.10 2003/06/17 19:24:20 bursa Exp $
*
* This module handles fetching of data from any url.
*
@@ -285,6 +285,7 @@ void fetch_poll(void)
CURLMsg * curl_msg;
struct fetch *f;
void *p;
+ void (*callback)(fetch_msg msg, void *p, char *data, unsigned long size);
/* do any possible work on the current fetches */
do {
@@ -305,20 +306,21 @@ void fetch_poll(void)
/* inform the caller that the fetch is done */
finished = 0;
+ callback = f->callback;
p = f->p;
if (curl_msg->data.result == CURLE_OK && f->had_headers)
finished = 1;
else if (curl_msg->data.result == CURLE_OK)
- f->callback(FETCH_ERROR, f->p, "No data received", 0);
+ callback(FETCH_ERROR, f->p, "No data received", 0);
else if (curl_msg->data.result != CURLE_WRITE_ERROR)
- f->callback(FETCH_ERROR, f->p, f->error_buffer, 0);
+ callback(FETCH_ERROR, f->p, f->error_buffer, 0);
/* clean up fetch */
fetch_abort(f);
/* postponed until after abort so that queue fetches are started */
if (finished)
- f->callback(FETCH_FINISHED, p, 0, 0);
+ callback(FETCH_FINISHED, p, 0, 0);
break;