summaryrefslogtreecommitdiff
path: root/src/IO/mime.c
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2013-01-03 07:47:25 +0000
committercorvid <corvid@lavabit.com>2013-01-03 07:47:25 +0000
commit366660644ca6fb23c158db6f42a987c16a037d6d (patch)
tree87e18b3b14f3dc055d6e769caa9e899bfe40e4f7 /src/IO/mime.c
parent93e772ac635f029405443cfc1eab60a111ff83f9 (diff)
web dispatch, don't prepare for display if the content type isn't viewable
Alexander had found a problem with background color: http://lists.auriga.wearlab.de/pipermail/dillo-dev/2012-December/009710.html
Diffstat (limited to 'src/IO/mime.c')
-rw-r--r--src/IO/mime.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/IO/mime.c b/src/IO/mime.c
index 3606d23c..19311b06 100644
--- a/src/IO/mime.c
+++ b/src/IO/mime.c
@@ -116,16 +116,14 @@ void a_Mime_init()
/*
- * Call the handler for the MIME type to set Call and Data as appropriate
+ * Get the handler for the MIME type.
*
* Return Value:
- * On success: a new Dw (and Call and Data properly set).
- * On failure: NULL (and Call and Data untouched).
+ * On success: viewer
+ * On failure: NULL
*/
-void *a_Mime_set_viewer(const char *content_type, void *Ptr,
- CA_Callback_t *Call, void **Data)
+Viewer_t a_Mime_get_viewer(const char *content_type)
{
-
Viewer_t viewer;
uint_t MinSize, MajSize, i;
const char *str = content_type;
@@ -137,16 +135,9 @@ void *a_Mime_set_viewer(const char *content_type, void *Ptr,
}
MinSize = i;
- /* Try minor type */
viewer = Mime_minor_type_fetch(content_type, MinSize);
- if (viewer)
- return viewer(content_type, Ptr, Call, Data);
-
- /* Try major type */
- viewer = Mime_major_type_fetch(content_type, MajSize);
- if (viewer)
- return viewer(content_type, Ptr, Call, Data);
+ if (!viewer)
+ viewer = Mime_major_type_fetch(content_type, MajSize);
- /* Type not handled */
- return NULL;
+ return viewer;
}