diff options
author | corvid <corvid@lavabit.com> | 2013-01-03 07:47:25 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2013-01-03 07:47:25 +0000 |
commit | 366660644ca6fb23c158db6f42a987c16a037d6d (patch) | |
tree | 87e18b3b14f3dc055d6e769caa9e899bfe40e4f7 /src/IO | |
parent | 93e772ac635f029405443cfc1eab60a111ff83f9 (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')
-rw-r--r-- | src/IO/mime.c | 23 | ||||
-rw-r--r-- | src/IO/mime.h | 3 |
2 files changed, 8 insertions, 18 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; } diff --git a/src/IO/mime.h b/src/IO/mime.h index 0f20cf6d..1f3b1ce5 100644 --- a/src/IO/mime.h +++ b/src/IO/mime.h @@ -41,8 +41,7 @@ void *a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call, * Functions defined inside Mime module */ void a_Mime_init(void); -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); #ifdef __cplusplus } |