From 4a80cad6cba3a9894a78c96df62c752cace5880f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 28 May 2008 17:13:39 +0200 Subject: [PATCH] Unhandled HTTP request is turned in to HTTP response 500 (server error). --- src/filter_frontend_net.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/filter_frontend_net.cpp b/src/filter_frontend_net.cpp index 1bee3cd..f2e0b88 100644 --- a/src/filter_frontend_net.cpp +++ b/src/filter_frontend_net.cpp @@ -148,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()) -- 1.7.10.4