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/web.cc | |
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/web.cc')
-rw-r--r-- | src/web.cc | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -55,9 +55,12 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web, dReturn_val_if_fail(Web->bw != NULL, -1); - // get the Layout object from the bw structure. Layout *layout = (Layout*)Web->bw->render_layout; + Viewer_t viewer = a_Mime_get_viewer(Type); + if (viewer == NULL) + return -1; + if (Web->flags & WEB_RootUrl) { /* We have RootUrl! */ @@ -69,7 +72,7 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web, StyleEngine styleEngine (layout); styleEngine.startElement ("body"); - dw = (Widget*) a_Mime_set_viewer(Type, Web, Call, Data); + dw = (Widget*) viewer(Type, Web, Call, Data); if (dw == NULL) return -1; @@ -96,7 +99,7 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web, } else { /* A non-RootUrl. At this moment we only handle image-children */ if (!dStrnAsciiCasecmp(Type, "image/", 6)) { - dw = (Widget*) a_Mime_set_viewer(Type, Web, Call, Data); + dw = (Widget*) viewer(Type, Web, Call, Data); } else { MSG_HTTP("'%s' cannot be displayed as image; has media type '%s'\n", URL_STR(Web->url), Type); |