Added marcxml schema.
[metaproxy-moved-to-github.git] / src / filter_frontend_net.cpp
index 22a3a9d..f2e0b88 100644 (file)
@@ -1,7 +1,5 @@
-/* $Id: filter_frontend_net.cpp,v 1.26 2008-02-20 15:07:51 adam Exp $
-   Copyright (c) 2005-2008, Index Data.
-
-This file is part of Metaproxy.
+/* This file is part of Metaproxy.
+   Copyright (C) 2005-2008 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
@@ -14,10 +12,9 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with Metaproxy; see the file LICENSE.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
- */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 
 #include "config.hpp"
 
@@ -151,8 +148,18 @@ void mp::ThreadPoolPackage::result()
                 "unhandled Z39.50 request");
 
             m_session->send_Z_PDU(apdu_response, &len);
-            m_package->session().close();
         }
+        else if (z_gdu && z_gdu->which == Z_GDU_HTTP_Request)
+        {
+            // For HTTP, respond with Server Error
+            int len;
+            mp::odr odr;
+            Z_GDU *zgdu_res 
+                = odr.create_HTTP_Response(m_package->session(), 
+                                           z_gdu->u.HTTP_Request, 500);
+            m_session->send_GDU(zgdu_res, &len);
+        }
+        m_package->session().close();
     }
 
     if (m_session->m_no_requests == 0 && m_package->session().is_closed())