summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2005-01-03 02:09:20 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2005-01-03 02:09:20 +0000
commit77de9c13364ab754a5490156afe26e56882f728b (patch)
treed9fee9dc41d893c6256b8848d57f1f1643a017e4 /content
parentbd5ba01b2ea32563dde5d80ad0560d45f263fecc (diff)
downloadnetsurf-77de9c13364ab754a5490156afe26e56882f728b.tar.gz
netsurf-77de9c13364ab754a5490156afe26e56882f728b.tar.bz2
[project @ 2005-01-03 02:09:20 by jmb]
Shift + Click == download svn path=/import/netsurf/; revision=1429
Diffstat (limited to 'content')
-rw-r--r--content/content.c1
-rw-r--r--content/content.h1
-rw-r--r--content/fetchcache.c12
-rw-r--r--content/fetchcache.h3
4 files changed, 13 insertions, 4 deletions
diff --git a/content/content.c b/content/content.c
index 7dd85a668..7bade8760 100644
--- a/content/content.c
+++ b/content/content.c
@@ -279,6 +279,7 @@ struct content * content_create(const char *url)
c->source_size = 0;
c->total_size = 0;
c->no_error_pages = false;
+ c->download = false;
c->error_count = 0;
c->prev = 0;
diff --git a/content/content.h b/content/content.h
index da565c711..387fc7a37 100644
--- a/content/content.h
+++ b/content/content.h
@@ -242,6 +242,7 @@ struct content {
unsigned long total_size; /**< Total data size, 0 if unknown. */
bool no_error_pages; /**< Used by fetchcache(). */
+ bool download; /**< Used by fetchcache(). */
/** Array of first n rendering errors or warnings. */
struct {
diff --git a/content/fetchcache.c b/content/fetchcache.c
index 81c608b9e..32e201081 100644
--- a/content/fetchcache.c
+++ b/content/fetchcache.c
@@ -53,6 +53,7 @@ static void fetchcache_error_page(struct content *c, const char *error);
* \param post_urlenc url encoded post data, or 0 if none
* \param post_multipart multipart post data, or 0 if none
* \param cookies send and accept cookies
+ * \param download download, rather than render content
* \return a new content, or 0 on memory exhaustion
*
* On success, call fetchcache_go() to start work on the new content.
@@ -66,7 +67,8 @@ struct content * fetchcache(const char *url,
bool no_error_pages,
char *post_urlenc,
struct form_successful_control *post_multipart,
- bool cookies)
+ bool cookies,
+ bool download)
{
struct content *c;
char *url1;
@@ -105,6 +107,7 @@ struct content * fetchcache(const char *url,
c->width = width;
c->height = height;
c->no_error_pages = no_error_pages;
+ c->download = download;
return c;
}
@@ -223,8 +226,11 @@ void fetchcache_callback(fetch_msg msg, void *p, const char *data,
return;
}
type = content_lookup(mime_type);
- LOG(("FETCH_TYPE, type %u", type));
- res = content_set_type(c, type, mime_type, params);
+ LOG(("FETCH_TYPE, type %u", c->download ?
+ CONTENT_OTHER : type));
+ res = content_set_type(c,
+ c->download ? CONTENT_OTHER : type,
+ mime_type, params);
free(mime_type);
for (i = 0; params[i]; i++)
free(params[i]);
diff --git a/content/fetchcache.h b/content/fetchcache.h
index f20ab6cf9..68fe3fd7f 100644
--- a/content/fetchcache.h
+++ b/content/fetchcache.h
@@ -29,7 +29,8 @@ struct content * fetchcache(const char *url,
bool no_error_pages,
char *post_urlenc,
struct form_successful_control *post_multipart,
- bool cookies);
+ bool cookies,
+ bool download);
void fetchcache_go(struct content *content, char *referer,
void (*callback)(content_msg msg, struct content *c, void *p1,
void *p2, union content_msg_data data),