From: Adam Dickmeiss Date: Wed, 19 Jun 2013 10:47:12 +0000 (+0200) Subject: http_file: raw mode functional X-Git-Tag: v1.3.59~56 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=abb6c0e006a3701899adcfaaedba3be405df3248;p=metaproxy-moved-to-github.git http_file: raw mode functional and schema updated accordingly --- 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 }? }*