+
+// mp_util::SRU::SRU_protocol_type
+// mp_util::SRU::protocol(const Z_HTTP_Request &http_req) const
+// {
+// const std::string mime_urlencoded("application/x-www-form-urlencoded");
+// const std::string mime_text_xml("text/xml");
+// const std::string mime_soap_xml("application/soap+xml");
+
+// const std::string http_method(http_req.method);
+// const std::string http_type
+// = mp_util::http_header_value(http_req.headers, "Content-Type");
+
+// if (http_method == "GET")
+// return SRU_GET;
+
+// if (http_method == "POST"
+// && http_type == mime_urlencoded)
+// return SRU_POST;
+
+// if ( http_method == "POST"
+// && (http_type == mime_text_xml
+// || http_type == mime_soap_xml))
+// return SRU_SOAP;
+
+// return SRU_NONE;
+// }
+
+// std::string
+// mp_util::sru_protocol(const Z_HTTP_Request &http_req) const
+// {
+// const std::string mime_urlencoded("application/x-www-form-urlencoded");
+// const std::string mime_text_xml("text/xml");
+// const std::string mime_soap_xml("application/soap+xml");
+
+// const std::string http_method(http_req.method);
+// const std::string http_type
+// = mp_util::http_header_value(http_req.headers, "Content-Type");
+
+// if (http_method == "GET")
+// return "SRU GET";
+
+// if (http_method == "POST"
+// && http_type == mime_urlencoded)
+// return "SRU POST";
+
+// if ( http_method == "POST"
+// && (http_type == mime_text_xml
+// || http_type == mime_soap_xml))
+// return "SRU SOAP";
+
+// return "HTTP";
+// }
+
+// std::string
+// mp_util::debug_http(const Z_HTTP_Request &http_req) const
+// {
+// std::string message("<html>\n<body>\n<h1>"
+// "Metaproxy SRUtoZ3950 filter"
+// "</h1>\n");
+
+// message += "<h3>HTTP Info</h3><br/>\n";
+// message += "<p>\n";
+// message += "<b>Method: </b> " + std::string(http_req.method) + "<br/>\n";
+// message += "<b>Version:</b> " + std::string(http_req.version) + "<br/>\n";
+// message += "<b>Path: </b> " + std::string(http_req.path) + "<br/>\n";
+
+// message += "<b>Content-Type:</b>"
+// + mp_util::http_header_value(http_req.headers, "Content-Type")
+// + "<br/>\n";
+// message += "<b>Content-Length:</b>"
+// + mp_util::http_header_value(http_req.headers, "Content-Length")
+// + "<br/>\n";
+// message += "</p>\n";
+
+// message += "<h3>Headers</h3><br/>\n";
+// message += "<p>\n";
+// Z_HTTP_Header* header = http_req.headers;
+// while (header){
+// message += "<b>Header: </b> <i>"
+// + std::string(header->name) + ":</i> "
+// + std::string(header->value) + "<br/>\n";
+// header = header->next;
+// }
+// message += "</p>\n";
+// message += "</body>\n</html>\n";
+// return message;
+// }
+
+// void mp_util::http_response(metaproxy_1::Package &package,
+// const std::string &content,
+// int http_code) const
+// {
+
+// Z_GDU *zgdu_req = package.request().get();
+// Z_GDU *zgdu_res = 0;
+// mp::odr odr;
+// zgdu_res
+// = odr.create_HTTP_Response(package.session(),
+// zgdu_req->u.HTTP_Request,
+// http_code);
+
+// zgdu_res->u.HTTP_Response->content_len = content.size();
+// zgdu_res->u.HTTP_Response->content_buf
+// = (char*) odr_malloc(odr, zgdu_res->u.HTTP_Response->content_len);
+
+// strncpy(zgdu_res->u.HTTP_Response->content_buf,
+// content.c_str(), zgdu_res->u.HTTP_Response->content_len);
+
+// //z_HTTP_header_add(odr, &hres->headers,
+// // "Content-Type", content_type.c_str());
+// package.response() = zgdu_res;
+// }
+