From abb6c0e006a3701899adcfaaedba3be405df3248 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 19 Jun 2013 12:47:12 +0200 Subject: [PATCH] http_file: raw mode functional and schema updated accordingly --- etc/config4.xml | 15 ++++++++++----- src/filter_http_file.cpp | 10 ++++------ xml/schema/filter_http_file.rnc | 3 ++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/etc/config4.xml b/etc/config4.xml index 02899d2..733791e 100644 --- a/etc/config4.xml +++ b/etc/config4.xml @@ -13,11 +13,16 @@ M - /etc/mime.types - - . - /etc - + /etc/mime.types + + . + /etc + + + . + /raw + true + diff --git a/src/filter_http_file.cpp b/src/filter_http_file.cpp index 1038eab..64efa72 100644 --- a/src/filter_http_file.cpp +++ b/src/filter_http_file.cpp @@ -175,16 +175,14 @@ void yf::HttpFile::Rep::fetch_file(mp::Session &session, fclose(f); Z_GDU *gdu = 0; + mp::odr decode(ODR_DECODE); if (raw) { - odr_setbuf(o, (char *) fbuf, sz, 0); - int r = z_GDU(o, &gdu, 0, 0); + odr_setbuf(decode, (char *) fbuf, sz, 0); + int r = z_GDU(decode, &gdu, 0, 0); if (!r) { - Z_GDU *gdu = o.create_HTTP_Response(session, req, 500); - package.response() = gdu; - fclose(f); - return; + gdu = o.create_HTTP_Response(session, req, 500); } } else diff --git a/xml/schema/filter_http_file.rnc b/xml/schema/filter_http_file.rnc index 5cf6199..8f5dd58 100644 --- a/xml/schema/filter_http_file.rnc +++ b/xml/schema/filter_http_file.rnc @@ -9,6 +9,7 @@ filter_http_file = element mp:mimetypes { xsd:string }, element mp:area { element mp:documentroot { xsd:string }, - element mp:prefix { xsd:string } + element mp:prefix { xsd:string }, + element mp:raw { xsd:boolean }? }* -- 1.7.10.4