zoom: sync up with Pazpar2 WRT authentication handling MP-492
[metaproxy-moved-to-github.git] / src / filter_http_file.cpp
index 1038eab..defac58 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of Metaproxy.
-   Copyright (C) 2005-2013 Index Data
+   Copyright (C) Index Data
 
 Metaproxy is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -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