/* This file is part of Metaproxy.
- Copyright (C) 2005-2012 Index Data
+ Copyright (C) 2005-2013 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
{
std::string file_part = fname;
std::string::size_type p = fname.find_last_of('/');
-
+
if (p != std::string::npos)
file_part = fname.substr(p+1);
std::string &fname, mp::Package &package)
{
mp::odr o;
-
+
FILE *f = fopen(fname.c_str(), "rb");
if (!f)
{
}
}
fclose(f);
-
+
std::string content_type = get_mime_type(fname);
z_HTTP_header_add(o, &hres->headers,
bool sane = true;
std::string::size_type p;
std::string path = req->path;
-
+
p = path.find("#");
if (p != std::string::npos)
path = path.erase(p);
}
package.move();
}
-
+
void yf::HttpFile::process(mp::Package &package) const
{
Z_GDU *gdu = package.request().get();
throw mp::filter::FilterException
("Can not open mime types file " + fname);
}
-
+
std::vector<std::string> args;
while (f.getline(args))
{
{
if (a_node->type != XML_ELEMENT_NODE)
continue;
-
+
if (mp::xml::is_element_mp(a_node, "documentroot"))
a.m_file_root = mp::xml::get_text(a_node);
else if (mp::xml::is_element_mp(a_node, "prefix"))
a.m_url_path_prefix = mp::xml::get_text(a_node);
else
throw mp::filter::FilterException
- ("Bad element "
+ ("Bad element "
+ std::string((const char *) a_node->name)
+ " in area section"
);
else
{
throw mp::filter::FilterException
- ("Bad element "
+ ("Bad element "
+ std::string((const char *) ptr->name)
+ " in virt_db filter");
}